"Bob Tilley (AT&T)" <[EMAIL PROTECTED]> writes:

> I wish to use the expression "catl <filename>" to execute the
> commands "cat <filename> | less".
>
> Is it possible to use 'alias' in the definition?
>
> "alias catl='cat $0 | less'" seems like a good idea, but I don't
> know if the '$0' works in a simple alias.

I think in Bourne-style shells (bash, ash, ksh, zsh), you almost
always want to use shell functions instead of aliases:

  catl() { cat "$@" | less }

(Where "$@" is sh-ish for "all of the rest of the command-line
arguments, quoted correctly".)

-- 
David Maze         [EMAIL PROTECTED]      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
        -- Abra Mitchell


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to