tags:

views:

38

answers:

1

If there is any possibility to use the parameters in zsh aliases? Something like this:

 alias ssh_nokia="ssh root@<ip_parameter>"

Usage:

 ssh_nokia 192.168.1.2
+4  A: 

In your particular case

alias ssh_nokia='ssh -l root'

Generally

ssh_nokia() {
    ssh root@"$*"
}

is equivalent to alias (will produce ssh root@1stparam 2ndparam 3rdparam …).

Michael Krelin - hacker
Or just "$*" to get the whole rest of the command line.
Paul Tomblin
Paul, good point, I'll edit it into reply.
Michael Krelin - hacker