Getting location of the script which is currently being executed
I have a shell script named a.sh inside /home/root directory and I have to run this script from the /tmp directory.
I issue the command as
linux-7vps: /tmp # ./home/root/a.sh
Now inside a.sh, I would like to get the path where this script a.sh resides without opting for a search.
Can I get the location of the script ?
Please let me know how to do it ?
Linux Flavor : RHEL 4/ RHEL 5
Thanks in Advance,