[ncl-talk] problem with running ncl script within bash

Mary Haley haley at ucar.edu
Wed Jan 25 22:19:55 MST 2017


Ipsita,

I wasn't sure of the best way to do this, so I just googled it.

Here's one possible answer:

http://unix.stackexchange.com/questions/171677/cd-into-all-directories-execute-command-on-files-in-that-directory-and-return/171679

--Mary


On Mon, Jan 23, 2017 at 10:38 AM, Ipsita Putatunda <
ipsita.putatunda at gmail.com> wrote:

> Dear all,
> 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.
>
> Part of my bash script is as below.
> Looking inside each folder (A to Z) and running xx2.ncl is the one where I
> got stuck.
>
>
>
> .................
> ..............
> while [  -s fish1 ]; do                 #lopp over all files
> .....................
> ....................
> FILENAME=`echo "$line" | awk -F - '{ print $1}'`
> echo "Reading file $FILENAME"
>  alias dnm= "cd $FILENAME"
>  echo "$dnm"
>  #ncl xx2.ncl
>  unalias dnm
> done
>
> Any help in this issue will be appreciated.
>
> Regards,
> Ipsita
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170125/789e7fa2/attachment.html 


More information about the ncl-talk mailing list