I used to use CShell (csh), which lets you make an alias that takes a parameter. The notation was something like
alias junk=\"mv \\\\!* ~/.Trash\"
For taking parameters, you should use functions!
However $@ get interpreted when creating the alias instead of during the execution of the alias and escaping the $ doesn’t work either. How do I solve this problem?
You need to use shell function instead of an alias to get rid of this problem. You can define foo as follows:
function foo() { /path/to/command "$@" ;}
OR
foo() { /path/to/command "$@" ;}
Finally, call your foo() using the following syntax:
foo arg1 arg2 argN
Make sure you add your foo() to ~/.bash_profile
or ~/.zshrc
file.
In your case, this will work
function trash() { mv $@ ~/.Trash; }