alias - how to pass parameter?

I want to define alias ‘nfu’ that works like that:
if I write in commad line:
nfu 0
it will execute:
umount /dev/io-net/en0

why this alias doesn’t work in that way:
alias nfu=‘umount /dev/io-net/en$1’
?

Q <no@spam.pl> wrote:

I want to define alias ‘nfu’ that works like that:
if I write in commad line:
nfu 0
it will execute:
umount /dev/io-net/en0

why this alias doesn’t work in that way:
alias nfu=‘umount /dev/io-net/en$1’
?

Aliases don’t pass parameters – they are simply expanded in place.
You can’t do what you want as an alias – but you could as a shell
function.

Try:

function nfu
{
umount /dev/io-net/en$1
}

-David



\

David Gibbs
QNX Training Services
dagibbs@qnx.com

David Gibbs <dagibbs@qnx.com> wrote:

Aliases don’t pass parameters – they are simply expanded in place.
You can’t do what you want as an alias – but you could as a shell
function.

Try:

function nfu
{
umount /dev/io-net/en$1
}

I’ve added this information to the Neutrino User’s Guide.


Steve Reid stever@qnx.com
Technical Editor
QNX Software Systems