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

Re: [TCLUG:17715] Aliasing



Nick.T.Reinking@supervalu.com wrote:
> 
> No, no.  I know how aliasing works.  But I need to alias
> something with a space in it, and nothing works.  I've tried:
> 
> alias 'ps aux'='ps -ef'
> and
> alias 'ps\ aux'='ps -ef'
> and
> alias ps\aux='ps -ef'
> etc...

Maybe it would be better to make a shell script.. ps-script or
something.  It would look something like (I'm sure my syntax is broken
somewhere ;-)

#!/bin/sh

if [ "$1" == "aux" ]; then
  ps -ef
else
  ps $*
fi

then just alias the script to `ps'..

alias 'ps'='ps-script'

-- 
 _  _  _  _ _  ___    _ _  _  ___ _ _  __   Who is "they" anyway? 
/ \/ \(_)| ' // ._\  / - \(_)/ ./| ' /(__                              
\_||_/|_||_|_\\___/  \_-_/|_|\__\|_|_\ __)                             
[ Mike Hicks | http://umn.edu/~hick0088/ | mailto:hick0088@tc.umn.edu ]