![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem Setting $PATH | greengrass | SUN Solaris | 1 | 04-07-2007 08:40 PM |
| Setting path | radhika03 | Shell Programming and Scripting | 5 | 01-22-2007 09:11 AM |
| Setting $PATH for a particular file...???? | moxxx68 | UNIX for Dummies Questions & Answers | 4 | 10-08-2004 12:23 AM |
| Setting path for GCC? | HOUSCOUS | UNIX for Dummies Questions & Answers | 2 | 09-16-2003 08:44 PM |
| Global PATH setting | jxh | UNIX for Dummies Questions & Answers | 5 | 07-20-2001 02:23 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help on setting path variable
Hi there,
I need help on setting the path variable. How can I set the path variable with Bourne Shell. My scripts goes like this, but did not work. #!/bin/sh PATH=/usr/bin:/usr/ucb:/etc:/export/home/zchen/home export PATH Thanks, Z |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
You have the correct syntax. What is the problem you are experiencing?
|
|
#3
|
||||
|
||||
|
How did you invoke the script ?
Try this Code:
. myscript.sh Code:
source myscript.sh |
|
#4
|
|||
|
|||
|
when i invoke the script by using interactive command, i.e.
set path=($path /export/home/zchen/home) it works fine, but when i invoke by sh myscript.sh, it does not work. any idea? |
|
#5
|
|||
|
|||
|
Like vino said, if you want the PATH to affect your current shell, you need to source the script. Look at his post again.
|
|||
| Google The UNIX and Linux Forums |