
July 11th, 2012, 12:09 PM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 15
Time spent in forums: 2 h 56 m 55 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by sujoydc Hello,
I want to execute a file (runFile.sh) from a different directory.
Inside 'runFile.sh' (which is not my code so I can't change this file) first few lines are like this:
So, when I try to call this file it is failing saying that 'env.sh' not found.
My Code:
Code:
#!/usr/bin/ksh
FOLDER_ID=19
/app/peter/Source/patch/$FOLDER_ID/runFile.sh >> spitOut.log
....
Then I changed code like this.
Code:
#!/usr/bin/ksh
BASE_LOC=/home/base
BASE_SOURCE_LOC=/app/peter/Source
FOLDER_ID=19
`cd $BASE_SOURCE_LOC/patch/$FOLDER_ID`
echo "Directory changed to:"`pwd`
./runFile.sh >> spitOut.log
`cd $BASE_LOC/files`
echo "Directory changed to:"`pwd`
When I run this file the cd command doesn't work.
How can I solve this problem? |
This usually isn't a problem when you just use absolute paths to rather than using cd to change directories.
How are you executing this? through crontab?
|