Skip to main content
2 of 3
added 492 characters in body

You can also use one of these methods:

Sequential execution, one after another:

alias1 && alias2

Simultaneous execution, in background:

alias1 & alias2

As a one liner:

alias1; alias2

For chaining a sequence of commands, try this:

alias x='command1;command2;command3;'

Or you can do this:

alias x='command1 && command2 && command3'

The && makes it only execute subsequent commands if the previous returns successful.

Also for entering passwords interactively, or interfacing with other programs like that, check out expect. (http://expect.nist.gov/)

Multiline alias in Bash
alias thing='(
cd "${program_to_update_dir}"
wget "https://raw.githubusercontent.com/USER/PROJECT/BRANCH/update.sh"
source update.sh
rm update.sh
)'

Shell functions may be define in the same initialization file that you define aliases in, and they are used in the same way as aliases, but are more versatile (can take arguments etc.) ...

Check this posts to: