Computing.Net > Forums > Unix > execute shell file in other dir

execute shell file in other dir

Reply to Message Icon

Original Message
Name: jenny.han
Date: March 20, 2003 at 20:03:45 Pacific
Subject: execute shell file in other dir
OS: UNIX
CPU/Ram: 2G
Comment:

I have a common shell script file need to be accessed from several files in other directories.

Time is urgent, although I know there are two ways for me to do this, but I don't know how.
1. write exact path
./region_apps/asia/rscgdc/rcrnsas/current/weekly/getmaillist.sh
or
.//region_apps/asia/rscgdc/rcrnsas/current/weekly/getmaillist.sh

Why failed?

2. Change PATH to include the directory which .sh file in
I use the following:
$ newpath='./region_apps/asia/rscgdc/rcrnsas/current/weekly/'
$ PATH=$newpath:$PATH

But this seems not functioning. When executing, system still reports: Not Found.

Please kindly advise on how to do. Thanks so much!


Report Offensive Message For Removal


Response Number 1
Name: Jimbo
Date: March 20, 2003 at 23:58:47 Pacific
Subject: execute shell file in other dir
Reply: (edit)

You should use the absolute path to the script. cd to the directory with the script and run a pwd command. This is the absolute path. It starts with a "/" not a dot.

-jim


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: execute shell file in other dir

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge