Recently i was adding some command aliases to .bash_aliases file in user home folder. I am wondering if there is some script that i can run to add aliases to that file. What I mean is : some script that first I can add as command alias and after that for example if I run command lets say
it will execute the script.
The script will do the following job:
Go to the end of the text file.
Add line for example :
Then save the file.
And finally reload the bash_aliases with command
But to make it even better script will first ask for alias name and then for a command to execute or file to execute.
Thats the thing that I dont know how to do. Can somebody lead me to the right direction?