I am writing a shell script, and I am fairly new to it, but when the script gets run, the first first/second argument (depending on how you look at it) will be the file to load and execute. My question is, how would I get the location of the file based on where what directory myscript
is run in?
myscript path/to/file.ext
myscript file.ext
myscript ../../file.ext
Basically I would like to get the path to the file that was passed in. How can that be done?