<div dir="ltr"><div class="gmail_default" style="font-size:small">Ipsita,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I wasn&#39;t sure of the best way to do this, so I just googled it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Here&#39;s one possible answer:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://unix.stackexchange.com/questions/171677/cd-into-all-directories-execute-command-on-files-in-that-directory-and-return/171679">http://unix.stackexchange.com/questions/171677/cd-into-all-directories-execute-command-on-files-in-that-directory-and-return/171679</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 23, 2017 at 10:38 AM, Ipsita Putatunda <span dir="ltr">&lt;<a href="mailto:ipsita.putatunda@gmail.com" target="_blank">ipsita.putatunda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Dear all,<br></div>I am running a bash script inside a directory (xx). Inside the xx directory there are other folders say A to Z containing some files, where xx2.ncl is one of them. Iwant to run xx2.ncl script for each A to Z folder.<br><br></div>Part of my bash script is as below.<br></div>Looking inside each folder (A to Z) and running xx2.ncl is the one where I got stuck.<br></div><br><div><div><div><div><br><br>.................<br><div>..............<br>while [  -s fish1 ]; do                 #lopp over all files<br>.....................<br>....................<br>FILENAME=`echo &quot;$line&quot; | awk -F - &#39;{ print $1}&#39;`<br>echo &quot;Reading file $FILENAME&quot;<br> alias dnm= &quot;cd $FILENAME&quot;<br> echo &quot;$dnm&quot;<br> #ncl xx2.ncl<br> unalias dnm<br>done<br><br></div><div>Any help in this issue will be appreciated.<br><br></div><div>Regards,<br></div><div>Ipsita<br></div></div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>