Problem: aliases and exec in shells
Marc Evans
evans at decvax.dec.com
Thu Oct 25 21:08:34 AEST 1990
Hi -
I made an interresting discovery concerning the use of exec in shells.
Specifically, I expected that something of the form 'exec foo' would look
through whatever search rules that would normally be used as though I had
used 'foo', and then replace my current process with what it found. This
in fact is not always the case.
In both ksh and csh, on many different vendors OS's that I have tried, if
foo is an alias for something, the alias is not used. For example, consider
the following:
% csh
% alias ls 'ls -F'
% exec ls
The result would be simply the results of running the ls command without
any arguments, rather than running the ls command with the argument -F.
The manuals and books that I have looked through don't define what the
behavior is suppose to be in this case, and looking through the sources
shows that aliases are in fact ignored. However, ksh functions could be
used, which provides for a reasonable hack-around.
Does the current behavior seem intuitive to people? Am I just expecting
something which I really shouldn't be? Your opinions are desired as I am
debating if I will ask certain vendors to change the behavior to pay
attention to the alias if it exists.
- Marc
--
===========================================================================
Marc Evans - WB1GRH - evans at decvax.DEC.COM | Synergytics (603)635-8876
Unix and X Software Contractor | 21 Hinds Ln, Pelham, NH 03076
===========================================================================
More information about the Comp.unix.programmer
mailing list