I am trying to write a script to update $PATH. Instead of hard coding the paths into the script itself I want to dynamically do this by capturing the full file path of the script itself.
I.e /loc1/loc2/loc3/modifypath.sh. instead of going export PATH="$PATH:/loc1/loc2/loc3" I want to extract the full file path from the script call into a variable to add to $PATH. That way no matter where the script is located it will modify $PATH with the location where it is.
Software/Hardware used: Linux Red Hat Enterprise 5.3
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!