TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:17715] Aliasing



Nick.T.Reinking@supervalu.com said:
> That doesn't work - you have to alias a command, not
> just text.  :)

No, you can alias something to any text you want, it just normally gets
ignored unless the alias matches the first word on the command line.  bash,
however, has the space-at-the-end-of-another-alias trick, allowing you to do:

alias ps='ps '
alias z='aux'
ps z
<system responds with ps aux output>

It _does_ work - I've done this example on two different systems. 
Unfortunately, both of them only have bash and csh installed and I know
nothing about csh, so I can't verify that it works in anything other than
bash.

(Say, Nick - since aliasing is a shell function, what shell are you using,
anyhow?)

-- 
"Two words: Windows survives." - Craig Mundie, Microsoft senior strategist
"So does syphillis. Good thing we have penicillin." - Matthew Alton
Geek Code 3.1:  GCS d- s+: a- C++ UL++$ P+>+++ L++>++++ E- W--(++) N+ o+ !K
w---$ O M- !V PS+ PE Y+ PGP t 5++ X+ R++ tv- b++ DI++++ D G e* h+ r++ y+