<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><BR class="khtml-block-placeholder"></DIV><DIV>A few elaborations that might help unix-newbies:</DIV><BR><DIV><DIV>On 3-Aug-06, at 12:25, Sampson, David wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">Dirty approach,</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">I used this approach when doing mass imports of files and only had slight variations.</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">under linux (shoudl work too in cygwin, dos batch would achieve the same thing)</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">I created a script file (executable text Basicaly) that for you would look like</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"># for a script named runme.sh</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">#(what ever header you need for your shell)</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"></SPAN><SPAN class="468230416-03082006">#!/bin/sh</SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN><BR></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Putting $!/bin/sh at the top of a script will ensure that the file gets interpreted by whatever the default shell is on the system.  Forcing other shells is also possible here, but using just "sh" means you get the default (i.e. as opposed to bash, csh, tcsh, ksh, etc etc).</DIV><BR><BLOCKQUOTE type="cite"><DIV dir="ltr" align="left"> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">v.in.asci (string of settings);</FONT></SPAN></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>note that should be ascii with two i's</DIV><BR><BLOCKQUOTE type="cite"> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">g.region (string of settings);</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">v.surf.rst (string of settings);</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">nviz (string of settings);</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">#end of script</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">then at the $prompt  you need to make the file executable</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">$chmod 777 runme.sh</FONT></SPAN></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Note this makes the file readable, writeable and executable to everyone on the system.  If this is just your own private linux or windows box, you probably don't care, but if someone is doing this on a multi-user system, you might not want other people to be able to edit your files.  Using chmod 755 would make it readable and executable to anyone, but only writeable to you, the owner of the file.  An alternative, more user-friendly syntax is</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>chmod u+x runme.sh</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>which simply says add the execute permission ("+x") for the User ("u") that owns runme.sh</DIV><BR><BLOCKQUOTE type="cite"> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">then at the $prompt inside a GRASS session you can run the file</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">$./runme.sh</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">boom!</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">notice in the script that each line ends in a ; (semi-colon) this separates each command</FONT></SPAN></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I don't think you need that.  It's C syntax to do that, not needed in a shell script unless you're concatenating multiple commands on to a single line.</DIV><BR><BLOCKQUOTE type="cite"> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">Note also that sometimes options need to be in quotes</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">eg</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">v.in.ascii option1="settings string that may contain escape characters or spaces";</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2">Alternatively you can capture what you enter at the CLI using </FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="468230416-03082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><FONT face="Arial" color="#0000ff" size="2"></FONT><BR> </DIV> <DIV class="OutlookMessageHeader" lang="en-us" dir="ltr" align="left"> <HR tabindex="-1"> <FONT face="Tahoma" size="2"><B>From:</B> grassuser-bounces@grass.itc.it [<A href="mailto:grassuser-bounces@grass.itc.it">mailto:grassuser-bounces@grass.itc.it</A>] <B>On Behalf Of </B>Tiago Salgueiro<BR><B>Sent:</B> August 3, 2006 11:24<BR><B>To:</B> <A href="mailto:grassuser@grass.itc.it">grassuser@grass.itc.it</A><BR><B>Subject:</B> [GRASS-user] run commands sequentially - help please<BR></FONT><BR></DIV> <DIV></DIV> <DIV class="Section1"> <H3><A name="_Toc119731566"><U><FONT face="Times New Roman" size="3"><SPAN style="FONT-SIZE: 12pt">Hi all</SPAN></FONT></U></A><SPAN style="TEXT-DECORATION: none">,</SPAN></H3><DIV><FONT face="Arial" size="2"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> <BR class="khtml-block-placeholder"></DIV><P class="MsoNormal"><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">First of all you should know that I’m a beginner using GRASS.</SPAN></FONT></P><DIV><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> <BR class="khtml-block-placeholder"></DIV><P class="MsoNormal"><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I want to create a 3D map from a text file with coordinates. I think the commands I will need are the following:</SPAN></FONT></P> <H3><FONT face="Times New Roman" size="3"><SPAN lang="EN-GB" style="FONT-SIZE: 12pt; TEXT-DECORATION: none"></SPAN></FONT> </H3> <H3><FONT face="Times New Roman" size="3"><SPAN lang="EN-GB" style="FONT-SIZE: 12pt; TEXT-DECORATION: none">1 - v.in.ascii</SPAN></FONT></H3> <H3><A name="_Toc119731567"><FONT face="Times New Roman" size="3"><SPAN lang="EN-GB" style="FONT-SIZE: 12pt; TEXT-DECORATION: none">2 - g.region</SPAN></FONT></A></H3> <H3><A name="_Toc119731569"><FONT face="Times New Roman" size="3"><SPAN lang="EN-GB" style="FONT-SIZE: 12pt; TEXT-DECORATION: none">3 - v.surf.rst</SPAN></FONT></A></H3> <H3><A name="_Toc119731571"><FONT face="Times New Roman" size="3"><SPAN lang="EN-GB" style="FONT-SIZE: 12pt; TEXT-DECORATION: none">4 – nviz</SPAN></FONT></A></H3><DIV><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> <BR class="khtml-block-placeholder"></DIV><P class="MsoNormal"><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">But I don’t want to write the commands every time I want to see a map. So I desire to do this sequentially. How can I do that? This way I’ll only need to run one command and the map happens.</SPAN></FONT></P><DIV><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> <BR class="khtml-block-placeholder"></DIV><P class="MsoNormal"><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks for your help.</SPAN></FONT></P><DIV><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> <BR class="khtml-block-placeholder"></DIV><DIV><FONT face="Arial" size="2"><SPAN lang="EN-GB" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> <BR class="khtml-block-placeholder"></DIV><P class="MsoNormal"><B><U><FONT face="Verdana" color="navy" size="2"><SPAN lang="EN-GB" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Verdana">Cumprimentos/Best Regards,</SPAN></FONT></U></B></P><P class="MsoNormal"><B><FONT face="Verdana" color="navy" size="3"><SPAN lang="EN-GB" style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: navy; FONT-FAMILY: Verdana"></SPAN></FONT></B> </P><P class="MsoNormal"><B><FONT face="Verdana" color="navy" size="2"><SPAN lang="EN-GB" style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Verdana">Tiago Salgueiro</SPAN></FONT></B></P><DIV><FONT face="Times New Roman" size="3"><SPAN lang="EN-GB" style="FONT-SIZE: 12pt"></SPAN></FONT> <BR class="khtml-block-placeholder"></DIV></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">grassuser mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:grassuser@grass.itc.it">grassuser@grass.itc.it</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://grass.itc.it/mailman/listinfo/grassuser">http://grass.itc.it/mailman/listinfo/grassuser</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>