<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Mark, it looks like you misinterpreted the last result.  I see the following, according to my suggestion #2.  Cd to "test", this is what you said you wanted.  Two different system commands, both including "cd".</div><div><br></div><div>Then you do a third system command without including "cd", and the previous change directory is forgotten, as expected.  Please re-read my explanation of sub shells.  Am I missing something in your question?<br><br>      .../mapp/ncl/test<br>      (0)     .../mapp/ncl/test<br>      .../mapp/ncl</div><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr">On Sun, May 17, 2020 at 12:22 PM M P via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks, the new code and response are below. I also modified the code after Dave's suggestion<div>but that does not improve.</div><div>I am sorry but that is a bummer,<br><div>Mark <div><br></div></div><div>(directory "./test" exits)</div><div>begin<br><br>   ncldir="./test"<br>   command="cd " + ncldir<br><br>   system("pwd")<br>   system(command)<br>   print(systemfunc(command))<br>   system("pwd")<br><br>end<br></div><div><br></div><div><div>..../mapp/ncl</div><div>(0)     missing<br>..../mapp/ncl<br></div><div><br></div></div><div>begin<br><br>   ncldir="./test"<br>   command="cd " + ncldir + "; pwd"<br><br>   system("pwd")<br>   system(command)<br>   print(systemfunc(command))<br>   system("pwd")<br><br>end<br><br>.../mapp/ncl</div><div>.../mapp/ncl/test<br>(0)     .../mapp/ncl/test<br>.../mapp/ncl<br><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 17, 2020 at 12:01 PM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Is it possible the system(command) call is failing?  Try something like this to verify:</div><div><br></div><div>     print(systemfunc(command))</div><div><br></div><div>Rick<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 17, 2020 at 11:33 AM M P via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div>I have a simple test script that is not doing the right thing.</div><div><div>The output is the same for both first and second system calls</div><div>so that the directory is not changed.</div><div></div></div><div>Can you help with a solution?</div><div>Thanks,</div><div>Mark</div><div><br></div><div>begin<br><br>   ncldir="./test"<br>   command="cd " + ncldir<br><br>   system("pwd")<br>   system(command)<br>   system("pwd")<br><br>end<br><br></div><div>..../mapp/ncl<br>..../mapp/ncl<br></div><div><br></div><div>(same with systemfunc)</div><div><br></div><div><br></div><div><br></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a></blockquote></div></div></div></div>