<div dir="ltr"><div><div>Thank you Nikos and Tom.<br></div>The command worked.<br>This is what I used,<br> for files in `cat NPPFILES`; do r.out.gdal in="${files}" out="${files}" format="GTiff"; done<br>
<br></div>Regards</div><div class="gmail_extra"><br clear="all"><div>Rajat Nayak</div>
<br><br><div class="gmail_quote">On Thu, Sep 4, 2014 at 12:39 PM, Nikos Alexandris <span dir="ltr"><<a href="mailto:nik@nikosalexandris.net" target="_blank">nik@nikosalexandris.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
Rajat Nayak <<a href="mailto:rajat27404@gmail.com">rajat27404@gmail.com</a>> wrote:<br>
<br>
> >> I just created a list of files (NPPFILES) using g,mlist command in<br>
> >> grass7. Now I would like to export these files as .tiff files.<br>
> >> I tried this command<br>
<br>
> >> for files in $NPPFILES; do<br>
> >> r.out.gdal input="$NPPFILES" output="$NPPFILES.tiff" format=GTiff ; done<br>
<br>
<br>
</div>Here, you ask the string "files" to get each of the whatsoever values<br>
are stored inside the variable $NPPFILES.<br>
<br>
1. is there an NPPFILES variable defined already? Something like<br>
<br>
NPPFILES="<br>
file_1<br>
file_2<br>
flie_3"<br>
<br>
2. What you actually need to feed the "input=" parameter, is the "files"<br>
term, not the "$NPPFILES".<br>
<div class=""><br>
<br>
> >> This is not working for me. I tried giving directory path, still no<br>
> >> result.<br>
<br>
<br>
</div>ok, assuming you are running this from inside a GRASSy session, you<br>
should be, at the time of executing the for loop, inside the directory<br>
where the "list of files" is also present. I guess you created a file,<br>
say "nppfiles_list".<br>
<br>
To be sure, just instruct<br>
<br>
cat nppfiles_list<br>
<br>
and expect to get the list of files you created.<br>
<br>
If that's ok, then it should work, e.g.:<br>
<br>
for File in `cat nppfiles_list`; do r.out.gdal input=${File}<br>
output=${File}.tiff; done<br>
<br>
Note, instead of "File" it could be any other string you like.<br>
<br>
Hope this helps a bit.<br>
<span class="HOEnZb"><font color="#888888"><br>
Nikos<br>
</font></span></blockquote></div><br></div>