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
Post a Comment