I believe system starts a subsidiary shell process to execute the command; backticks and qx behave similarly. Environment -- including directory -- changes in a sub-shell don't propogate up; child process don't change their parent's state. Something like system("cd $somedirectory")</tt) is, as far as the program is concerned, a no-op.
You have to use chdir.
emc
At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.
—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.In reply to Re: trouble with system commands
by swampyankee
in thread trouble with system commands
by tricolaire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |