Problem: aliases and exec in shells

Chet Ramey chet at cwns1.INS.CWRU.Edu
Fri Oct 26 05:32:20 AEST 1990


In article <427 at decvax.decvax.dec.com.UUCP> evans at decvax.DEC.COM writes:

[when the word to be aliased is not in a `command position']

>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 `ls' is not expanded]

A simple work around for both ksh and bash is the following:

alias exec="exec "

Then the word following the `exec' will be checked for aliases and
expanded if necessary.  `nohup' is handled the same way.

I don't think that all words of a command should be checked for aliases
and expanded.

Chet
-- 
Chet Ramey			``As I recall, Doug was keen on boxing.  But
Network Services Group		  when he learned to walk, he took up puttin'
Case Western Reserve University	  the boot in the groin.''
chet at ins.CWRU.Edu



More information about the Comp.unix.programmer mailing list