dowell
1
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??
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.
dowell
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.
dowell
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.
the . profile file usually resides in user home directory.
cd $HOME
ls -lart ---> list the files whose name starts with "." (hidden files)