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
More Related Contents:
- How to mkdir only if a directory does not already exist?
- Check if a file exists with a wildcard in a shell script [duplicate]
- How do I kill background processes / jobs when my shell script exits?
- How do I run a shell script without using “sh” or “bash” commands?
- Escaping in makefile
- How could the UNIX sort command sort a very large file?
- sed whole word search and replace
- Meaning of $? (dollar question mark) in shell scripts
- What is /dev/null 2>&1?
- Using find to locate files that match one of multiple patterns
- Compare two files line by line and generate the difference in another file
- Floating-point arithmetic in UNIX shell script
- Using wget to recursively fetch a directory with arbitrary files in it
- How to download GitHub Release from private repo using command line
- How to input a path with a white space?
- Do a tail -F until matching a pattern
- How to get “wc -l” to print just the number of lines without file name?
- Compare a string using sh shell
- Automate scp file transfer using a shell script
- What does set -e and exec “$@” do for docker entrypoint scripts?
- Make xargs handle filenames that contain spaces
- Why would I create an alias which creates a function?
- Curl to return http status code along with the response
- Block Comments in a Shell Script
- Emacs shell scripts – how to put initial options into the script?
- Input from within shell script
- How to run a shell script on every request?
- “No such file or directory” but it exists
- Unix shell script find out which directory the script file resides?
- How to check if an URL exists with the shell and probably curl?