It is necessary that the script itself is crammed into alias for the current user. edit .bashrc then we can from the script, but there is no update to the alias list. The ideal script behavior: - the first run of the sh script (alias sc is added) - repeated launches as sc
I add using the shell script alias:
echo "alias sc='sh ~/script.sh'" >> ~/.bashrc After that you should run the bashrc script itself so that the changes take effect before the reboot. If you run:
. ~/.bashrc Nothing will happen, tk. The file will simply be included in the script. Actually the question is how to update the list of aliases from the script?
alias alias_command_name='commands' It does not help, because it will work only for the current session.