OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Angstrom & OpenZaurus => Topic started by: systemparadox on April 01, 2005, 08:28:24 am

Title: $path Won't Export
Post by: systemparadox on April 01, 2005, 08:28:24 am
I feel very stupid having to ask this, I do a lot with shell scripts and I'm sure it's very simple, but I can't seem to change the $PATH with a shell script on OZ.

PATH=$PATH:/mnt/card/.zgcc/bin
export PATH

Why doesn't that work?

Thanks
Simon
Title: $path Won't Export
Post by: Greg2 on April 01, 2005, 08:51:11 am
Quote
I feel very stupid having to ask this, I do a lot with shell scripts and I'm sure it's very simple, but I can't seem to change the $PATH with a shell script on OZ.

PATH=$PATH:/mnt/card/.zgcc/bin
export PATH
I'm just learning shell scripts myself but I think it's

export PATH=”$PATH:/mnt/card/.zgcc/bin”

but I'm not positive... so I feel stupid to

Greg
Title: $path Won't Export
Post by: TimW on April 01, 2005, 09:06:21 am
Quote
This is the partially sighted leading the blind, but isn't export a bash built-in but oz runs sh by default?

BTW, both syntaxes should work, but AFAIK only in bash.

I checked and sh has export too so ignore me.
Title: $path Won't Export
Post by: silvio on April 01, 2005, 09:07:43 am
Quote
I feel very stupid having to ask this, I do a lot with shell scripts and I'm sure it's very simple, but I can't seem to change the $PATH with a shell script on OZ.

PATH=$PATH:/mnt/card/.zgcc/bin
export PATH

Why doesn't that work?

Thanks
Simon
[div align=\"right\"][a href=\"index.php?act=findpost&pid=73138\"][{POST_SNAPBACK}][/a][/div]

There is no syntax error...
You have to source a script if it should change the environment of the current shell:
Code: [Select]
---- file "changepath" ----
PATH=$PATH:/mnt/card/.zgcc/bin
export PATH
---- file "changepath" ----

source ./changepath

regards,
Silvio
Title: $path Won't Export
Post by: systemparadox on April 01, 2005, 09:16:27 am
root@collie:~# source /usr/bin/zgcc
-sh: source: not found

       
Title: $path Won't Export
Post by: silvio on April 01, 2005, 09:22:53 am
Quote
root@collie:~# source /usr/bin/zgcc
-sh: source: not found

      
[div align=\"right\"][a href=\"index.php?act=findpost&pid=73146\"][{POST_SNAPBACK}][/a][/div]
this is really stupid - is "source" an internal bash command?
You can use "." instead
Code: [Select]
. /usr/bin/zgccIf this will not work either please use a proper shell like bash.

regards,
Silvio