Differences between fish and bash to pass commandline arguments to alias functions?

Posted by NES on Ask Ubuntu See other posts from Ask Ubuntu or by NES
Published on 2011-01-02T15:12:57Z Indexed on 2011/01/02 15:59 UTC
Read the original article Hit count: 442

Filed under:
|
|

From the answers to my other question here i learned about the possibility to pass commandline arguments to a alias function in Bash.

In Fish i can edit an alias by editing the file config.fish in ~/.config/fish directory and adding a line like this

alias lsp='ls -ah --color=always | less -R;'

and it works perfectly. This should be the equivalent to editing ~/.bash_aliases in bash

But when i try to setup an alias function to pass arguments like this

alias lsp='_(){ ls -ah --color=always $* | less -R; }; _'

it doesn't work for fish?

Are there any differences between fish and bash in the way to setup an alias to pass commandline arguments that prevent this second alias from working with fish instead of bash?

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about bash