I'm trying to do my own command (test.sh
script).
The script works perfect and I created a soft link (i.e., ln -s /home/test.sh ~/bin/test
).
And when I call from anywhere inside RHEL, it also works perfectly.
But my problem is the next one:
When from the command line I'm writing the name of the command (test
), and I press the Tab key, the system shows me the full path and name of my script, i.e., $ /home/bin/test
, and I want that it only shows me the name of the command ($ test
).
Is that possible? How can I do it?
What you need is an alias. In RHEL/CENTOS systems, perform the below steps
vi ~/.bashrc
alias test='/home/test.sh'
source ~/.bashrc
(optional step, unless you want your current session to have the updated bashrc, else a restart/logout/login should not require this step!)