bash - perl how to finish the script by 'cd $newdir' -


i have perl script creates directory $newdir based on input passed parameter, , script finish it's execution doing:

cd $newdir 

so next command in bash linux 64bit (here program2) executed $newdir working directory.

e.g.:

perl $home/import_script.pl -i someparameter && $home/program2 . 

you can't.

any cd (or similar) run in perl script affect perl script (or sub-shell spawned perl script).

it can't affect parent shell directly.

the thing output directory , cd or similar. (e.g. cd "$(perl "$home"/import_script.pl -i someparameter)" && "$home/program2" . realize means can't output anything else standard output perl script or confuse cd.)

or have perl run second command also, etc.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -