in reply to Re^2: cd in perl not working?
in thread cd in perl not working?
Old thread, yes. But you got me thinking too. In the spirit of TMTOWTDI I offer an alternative: Put the commands in one system() call, separated by semicolons. Works for me using Perl 5.18.2 in Ubuntu 14.04 with Bash as default shell. Instead of tarring files I ran "ls -ao" after changing directories, as in the example below.
system("cd ~/jobs; ls -ao; cd ..");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: cd in perl not working?
by afoken (Chancellor) on Aug 14, 2014 at 19:08 UTC | |
by Bethany (Scribe) on Aug 15, 2014 at 01:32 UTC |