I have a lot of aliases and functions. I have a script that generates them based on the system in question so I can avoid runtime checks of whether the necessary applications are present. Most of my aliases come from this script. The only drawback is I have to remember to run this script and source my aliases again once in a while.
The script has a list of 'simple aliases', where this list of tuples has the required application, the name of the alias, and the actual command:
then it checks for the binary in PATH and adds the alias if it finds it.
I do not yet generate the functions output but I probably will soon, based on the dependencies.
Nowadays I prefer functions unless the alias is very simple like alias la='ls -la' or something I really don't feel like remembering: alias ltr='-l --sort=time -r.
The problem may be that completions are generally not available in Bash by default, and I know I find them invaluable, and I write my own quite a bit.
I have a lot of aliases and functions. I have a script that generates them based on the system in question so I can avoid runtime checks of whether the necessary applications are present. Most of my aliases come from this script. The only drawback is I have to remember to run this script and source my aliases again once in a while.
The script has a list of 'simple aliases', where this list of tuples has the required application, the name of the alias, and the actual command:
then it checks for the binary in
PATH
and adds the alias if it finds it.I do not yet generate the functions output but I probably will soon, based on the dependencies.
Nowadays I prefer functions unless the alias is very simple like
alias la='ls -la'
or something I really don't feel like remembering:alias ltr='-l --sort=time -r
.The problem may be that completions are generally not available in Bash by default, and I know I find them invaluable, and I write my own quite a bit.
Great! I also rely on history and filter (do not capture) ls and some often used commands to make it shorter