PDA

View Full Version : Unix shell scripters - file location in script


tymznd
05-11-2007, 03:04 AM
I am using symbolic links to manage files that are referenced.

I have written a BASH script that I can simply drop on the cmd line and hit enter... it then updates all the symbolic links that the maya file then uses to find the relevant references.

Does anyone know how to use the file location in the script itself to be used as a path variable?

Currently I doing something like:
setDir="house/room/chair"
projPath="${MAYA_SETS_DIR}${setDir}"
ln -f -s "${projPath}/${fileName}" "${projPath}/${fileNameSym}"

If I move the directory that contains this file I have to go in and update the relative path by hand, what I would rather do is:
projPath=`return_Path_Of_script_that_is_executing_this_code`

... like I said, this is all in a text.sh file that I drop onto the cmd line to execute... shouldn't it be able to know where it is?

CGTalk Moderation
05-11-2007, 03:04 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.