in reply to system ( "source $script" )
I'd like to implement an option where the user could see what the result of sourcing all of the init files would be.
Maybe something like this:
system ". $script && env | sort";
This would run a new shell, source the $script, and print the resulting environment. As it's a new shell, it wouldn't affect the parent shell (as desired).
(If you want a shell other than what 'perl -V:sh' reports (i.e. what Perl is using by default), you have to run it explicitly, e.g. system "/bin/tcsh", "-c", "shell code here...";)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: system ( "source $script" )
by ajwood (Novice) on Jan 28, 2011 at 21:24 UTC | |
by Anonyrnous Monk (Hermit) on Jan 28, 2011 at 21:44 UTC | |
by ajwood (Novice) on Jan 28, 2011 at 22:01 UTC | |
by Anonyrnous Monk (Hermit) on Jan 28, 2011 at 22:16 UTC | |
by JavaFan (Canon) on Jan 29, 2011 at 13:25 UTC | |
by eyepopslikeamosquito (Archbishop) on Jan 30, 2011 at 07:08 UTC |