Author Topic: $path Won't Export  (Read 3044 times)

systemparadox

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • http://www.systemparadox.co.uk
$path Won't Export
« 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
My Site: The System Paradox (http://www.systemparadox.co.uk)

FOR SALE: Zaurus SL-C750: /Symbol Spectrum24 CF WiFi/Pilot Pentopia extending stylus (worth every penny)/Currently running Cacko.

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
$path Won't Export
« Reply #1 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
« Last Edit: April 02, 2005, 01:16:57 pm by Greg2 »

TimW

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
$path Won't Export
« Reply #2 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.
« Last Edit: April 01, 2005, 09:56:17 am by TimW »

silvio

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • http://www.iaccarino.de/silvio
$path Won't Export
« Reply #3 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
« Last Edit: April 01, 2005, 09:09:55 am by silvio »
SL-C860, Cacko 1.22 lite and many toys.
My Zaurus stuff

systemparadox

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • http://www.systemparadox.co.uk
$path Won't Export
« Reply #4 on: April 01, 2005, 09:16:27 am »
root@collie:~# source /usr/bin/zgcc
-sh: source: not found

       
My Site: The System Paradox (http://www.systemparadox.co.uk)

FOR SALE: Zaurus SL-C750: /Symbol Spectrum24 CF WiFi/Pilot Pentopia extending stylus (worth every penny)/Currently running Cacko.

silvio

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • http://www.iaccarino.de/silvio
$path Won't Export
« Reply #5 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
SL-C860, Cacko 1.22 lite and many toys.
My Zaurus stuff