Path: utzoo!attcan!uunet!husc6!mailrus!bbn!rochester!pt.cs.cmu.edu!spice.cs.cmu.edu!jwz From: jwz@spice.cs.cmu.edu (Jamie Zawinski) Newsgroups: comp.sys.amiga Subject: aliases and RUN Message-ID: <3496@pt.cs.cmu.edu> Date: 5 Nov 88 22:04:49 GMT Sender: netnews@pt.cs.cmu.edu Organization: Carnegie-Mellon University, CS/RI Lines: 33 The problem proposed is this: One aliases 'cp' to the 'copy' command. 'cp foo bar' works, but 'run cp foo bar' doesn't. Someone suggested that aliases be expanded before being passed to RUN, which would make this problem go away. Someone else said that this would make 'delete cp' expand into 'delete copy', which is wrong. Well, the solution is to do this expansion of the second word only if the first word is 'RUN'. 'RUN' is magic, there's no way around that. This is a non-issue in the UNIX world, because the designers realized that spawning a process was a magic thing. You do that by 'cp foo bar &' - an ampersand at the end of the line. Then there's no first-word second-word dichotomy. Another win of the unix way is that you can do things like ( command-1 ; command-2 )& and have two things happen in series in the background. It takes some serious contortions to do that on the Amiga. So this RUN/alias is just another CLI bogosity as far as I'm concerned. Any slightly gross hack like special-casing the word RUN is worth it, since you're dealing with a silly system any way. Oh yeah, an implementation of this should be careful to compare the first word to RUN after expanding the first word, because that way you can still do: alias cp copy ; alias r run r cp foo bar and have it work. We shall cleanse the world!! Jamie Zawinski (jwz@spice.cs.cmu.edu or sun!sunpitt!eti!jwz)