|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Build .sh file?
I create a .sh file called cfg.sh, contents are as follow:
./configure --enable-so I set this file to executable and type ./cfg.sh to execute it. It work fine as what I expected! So, I create another file called cfgpath.sh, contents are as follow: PATH=/usr/local/bin:$PATH; export PATH; LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH I do the samething, set the .sh file to executable and type ./cfgpath.sh to run the unix script. But it doesn't perform. If I type echo $PATH, path did not set. I perfrom the path setting directly from # prompt and it work. Why? Thanks in advance. |
|
#2
|
|||
|
|||
|
Quote:
ypu have tou SOURCE the file ---> . ./filename note the dot before ./filename
__________________
working on Solaris[5-9], preferred languages french and C. |
|
#3
|
|||
|
|||
|
Quote:
I did use ./filename, as follow ./cfgpath.sh |
|
#4
|
|||
|
|||
|
You didn't look at what guggach said. Look again - there are two dots in what was posted. This does assume Borne or Korn shell, but based on your syntax it seems like you are already using one of those.
|
|
#5
|
|||
|
|||
|
Quote:
I'm using ./cfg.sh it is working, why when I use ./cfgpath.sh is not working? I know you suggest to use ../cfgpath.sh instead ./cfgpath.sh. But why? What is the reason behine it? I also wondering why the .sh script one can work, the other NOT? Enjoy your happy weekend!! |
|
#6
|
|||
|
|||
|
Quote:
DOT - SPACE - DOT - SLASH ... The first dot is a command! It does not work because a child cannot set the parent's environment. The "dot" prevents spawning a child process. hth, M.
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Build .sh file? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|