|
|
|
|
|
by chubot
1542 days ago
|
|
FWIW the title says "functions", but it apparently uses aliases. Shell functions have all the same functionality as aliases and they'll catch more syntax errors upon "source myscript". Example: ls() {
command ls --color=auto "$@"
}
is equivalent to alias ls='ls --color=auto'
but IMO less error prone. You also get syntax highlighting.The only tricky thing is to remember the 'command' prefix if the "alias" has the same name as the command. Otherwise you'll get an infinite loop of the function trying to call itself! |
|