in reply to Re: spawning shell commands with aliases
in thread spawning shell commands with aliases
Erm, if they use the full path that pretty much ensures what they're trying to have not happen happens.
The problem is that user A has ls aliased to, say, ls -FC; user B has it aliased to ls -lS (I don't even want to think what users C–Q have it aliased to, but you get the idea . . .). Many shells do not source the startup files which typically would contain the alias ls='ls -FC' lines if the shell is not an interactive shell. So when his wrapper mydiff calls system( $ARGV[0] ) the shell Perl execs (if it even does; in this simple case Perl will probably split on whitespace itself and call execvp directly, further complicating the issues since the user's shell doesn't even enter into the picture) is not expanding ls -1 a/ to ls -FC -1 a/ so the user doesn't get the output in the format they expect.
The underlying problem is that in all likelihood the users' shells are never entering into the picture, and even if they did they wouldn't have the aliases in question active.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: spawning shell commands with aliases
by swampyankee (Parson) on Dec 19, 2006 at 22:26 UTC | |
by Fletch (Bishop) on Dec 20, 2006 at 00:39 UTC |