This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Another dumb question



----- Original Message -----
From: "Paul Andrews" <paul.andrews@smartmove.co.nz>
To: "'Thunder Scientific Corporation'" <mike@ThunderScientific.com>;
<crossgcc@sourceware.cygnus.com>
Sent: Tuesday, March 28, 2000 3:55 PM
Subject: RE: Another dumb question


> > -----Original Message-----
> > From: Thunder Scientific Corporation
> > Sent: Wednesday, March 29, 2000 10:26 AM
> > To: crossgcc@sourceware.cygnus.com
> > Subject: Another dumb question
> >
> >
> > Wow! You folks helped me get sufficiently oriented to get a
> > hold of the
> > material  I needed to find and master.  Thanks a lot, everyone.
> >
> > So here is my other question:
> >     Why can't I change my PATH in a shell script?
> >
> > Suppose I wish to add the traditional /foo/bar to my search
> > path.  I can
> > type in "export PATH=$PATH:/foo/bar", and that works.  I.e.,
> > if I type "echo
> > $PATH" I get back my original path concatenated with
> > ":/foo/bar".  Yet if I
> > try putting this into a shell script I get no error messages but "echo
> > $PATH" returns the unmodified original search path.  None of
> > the variants
> > I've tried seems to work.  (I'm running a new Red Hat Linux 6.1
> > installation.)
> >
> > Why?
>
> My guess would be that the path does indeed change, but only during the
> script.

Your guess would be correct.  Shell scripts (ones that use #!
or are invoked as 'sh file-name', anyway)
start a new shell and when they are finished that shell exits.
If you want to change your base path, then it goes in .bashrc,
.profile, .cshrc, as appropriate based on your login shell.


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]