Path: utzoo!attcan!uunet!wuarchive!ukma!usenet.ins.cwru.edu!cwns1!chet From: chet@cwns1.INS.CWRU.Edu (Chet Ramey) Newsgroups: comp.unix.programmer Subject: Re: Problem: aliases and exec in shells Keywords: csh, ksh, exec Message-ID: <1990Oct25.193220.24361@usenet.ins.cwru.edu> Date: 25 Oct 90 19:32:20 GMT References: <427@decvax.decvax.dec.com.UUCP> Sender: news@usenet.ins.cwru.edu Reply-To: chet@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 31 Nntp-Posting-Host: cwns1.ins.cwru.edu In article <427@decvax.decvax.dec.com.UUCP> evans@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@ins.CWRU.Edu