0

I created a list of files (NPPFILES) using g.mlist command in GRASS 7. Now I would like to export these files as .tiff files. I tried this command in GRASS prompt

for files in $NPPFILES; do
r.out.gdal input="$NPPFILES" output="$NPPFILES.tiff" format=GTiff ; done

This is not working for me. I'm running it in the directory where output files need to be stored, still no result.

2

You need to iterate through the files, so your loop should be as follows:

for file in $NPPFILES
do
    r.out.gdal input=$file output=$file.tif format=GTiff 
done

You should add the semi-colons if you write the loop on one line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.