Re: Changing Directory Within NCL Script

From: Saji N. Hameed <saji_at_nyahnyahspammersnyahnyah>
Date: Fri, 3 Jul 2009 11:07:12 +0900

Hi Bruce,

It should not work. [As I understand it,] the commands passed through the
system function will be implemented in a child process,
and so it should have no effect on the NCL script (parent)
that called it (in real life though, children have
effects on parents :) ).

So I guess the only way is to orchestrate everything
from an external script (or better hardcode absolute
paths for your desired operations).

saji

--
* Lunde, Bruce N CIV NAVOCEANO, NP1 <bruce.lunde_at_navy.mil> [2009-07-02 18:11:12 -0400]:
> Hello,
> 
> I had wanted to change the current working
> directory within my NCL script.  I had
> tried doing  system("cd NewDir"), which
> did not work.  Testing with
> system("cd NewDir; ls")  confirmed that
> the new directory was changed to within
> the subshell of the system() command, but
> the current dir of the parent shell stayed
> the same.
> 
> In the talk archives I had seen responses
> to the same question which also suggested
> using system("cd NewDir").  Does this
> really work for someone ?
> 
> Thanks, Bruce
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- 
Saji N. Hameed
APEC Climate Center          				
1463 U-dong, Haeundae-gu,                               +82 51 745 3951
BUSAN 612-020, KOREA                    		saji_at_apcc21.net
Fax: +82-51-745-3999
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 02 2009 - 20:07:12 MDT

This archive was generated by hypermail 2.2.0 : Tue Jul 07 2009 - 11:13:18 MDT