How to pass command line arguments to a shell alias? [duplicate]

Just to reiterate what has been posted for other shells, in Bash the following works:

alias blah="function _blah(){ echo "First: $1"; echo "Second: $2"; };_blah"

Running the following:

blah one two

Gives the output below:

First: one
Second: two

Leave a Comment