![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to add new paths to $PATH | wrapster | SUN Solaris | 2 | 06-01-2008 01:46 AM |
| Multiple Paths to SAN with LVM in Linux? | deckard | Filesystems, Disks and Memory | 3 | 08-10-2007 07:13 AM |
| create paths | alias47 | UNIX for Dummies Questions & Answers | 4 | 08-07-2007 06:14 AM |
| Checking the valid paths in the shell script | srivsn | Shell Programming and Scripting | 3 | 12-27-2005 09:05 PM |
| paths | caiohn | UNIX for Dummies Questions & Answers | 1 | 01-17-2001 04:35 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Enabling a script to run in multiple paths
I have a script that i need to run from different paths.
for example mypc/path1/path2/, mypc/path1/path2/path3/, and mypc/path1/path2/path3/path4 How do i set up that script so that it can execute in any of the above paths or how can i make it run on any path on my computer?? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Some possibilities:
- make an alias in your .profile - place the script in a directory that's set in the PATH variable - add the path of your script in the PATH variable Regards |
|
#3
|
||||
|
||||
|
To elaborate, there is a line in your .profile that says PATH=
The PATH defined has several paths listed, separated by colons. One of the PATHs is probably . by itself. A . by itself means 'current directory'. When you attempt to execute a command/script, the OS searches each of the paths listed in PATH to find the command/script you specified. Therefore, you have to put your script in one of the paths specified, or add the path where your script lives to the PATH variable. On a side note, the command which [command] returns the path of the [command] specified. |
|
#4
|
|||
|
|||
|
Thanx for the help but am a bit new in unix. Where do i find
that file for the user profiles that i need to edit the PATH variable. |
|
#5
|
|||
|
|||
|
Thanx for the help but am a bit new in unix. Where do i find
that file for the user profiles that i need to edit the PATH variable. |
|
#6
|
|||
|
|||
|
the . profile file usually resides in user home directory.
cd $HOME ls -lart ---> list the files whose name starts with "." (hidden files) |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|