I have certain paths, which are too long to type, so I need to wrap all those in one script as alias and source that script to my existing package code.
These should set alias permanently over that server or over the package, so every user can use the alias instead typing the whole path.
alias bc='bc -l'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias grep='grep --color'
alias update='yum update'
alias update='yum -y update'
I have tried this but it isn't working.
This is not the way to do this. Instead you need to set alias in your
.bashrcfile.If you want these alias for one tty only then put them in a bash script and source that script on that tty. You only need to change shebang header in your script from
Instead if you want these changes in alias to be permanent then you need to put these entries in your .bashrc file and they will be permanent.
If you want to make those changes for all users you can put that in
/etc/bashrcor/etc/bash.bashrcwhichever is present on your system and then make/etc/profileto source it.For example my machine is running ubuntu and it's /etc/profile entry is this way
So if i put alias in /etc/bash.bashrc then they will be available to all users.