[Gllug] simple bash problem

mike mike at redtux.demon.co.uk
Wed Jan 23 20:16:41 UTC 2002


On Wed, 2002-01-23 at 19:56, Richard Cohen wrote:
> On 23 Jan 2002, mike wrote:
> 
> > anyone got any idea why this is not working
> >
> > #!/bin/bash -v
> > export PATH='/usr/local/gnome/bin:$PATH'
> > export LD_LIBRARY_PATH=$'/usr/local/gnome/lib:$LD_LIBRARY_PATH'
> > export GNOME_PATH=$'/usr/local/gnome'
> > export PKG_CONFIG_PATH=$'/usr/local/gnome/lib/pkgconfig:/usr/lib'
> > export USE_GNOME_2_MACROS=1
> >
> > or this
> >
> > #!/bin/bash
> > PATH=/usr/local/gnome/bin:$PATH
> > export PATH
> > LD_LIBRARY_PATH=/usr/local/gnome/lib/:$LD_LIBRARY_PATH
> > export LD_LIBRARY_PATH
> > GNOME_PATH=/usr/local/gnome/
> > export GNOME_PATH
> > PKG_CONFIG_PATH=/usr/local/gnome/lib/pkgconfig/:/usr/lib
> > export PKG_CONFIG_PATH
> > USE_GNOME_2_MACROS="1"
> > export USE_GNOME_2_MACROS
> >
> > both run without error but dont do anything apart from set
> > USEER=Mike=_./programname
> 
> You can't set the environment for your parent process.  When you run these
> scripts, they run in a subshell, and change the environment in that
> subshell, when then closes, dumping the environment changes.
> 
> If you . in the script rather than running it straight out, it'll affect
> your current shell.  Like this:
> . ./script.sh
> rather than
> ./script.sh
> 
> Cheers
> Richard
thanks - that worked

BTW when I run the script everything is set apart from LD_LIBRARY_PATH
which shows LD_LIBRARY_PATH=/usr/local/gnome/lib/: and that is where it
ends

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list