public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: .BASHRC-problem
@ 1998-01-19 15:26 Earnie Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Earnie Boyd @ 1998-01-19 15:26 UTC (permalink / raw)
  To: juolja; +Cc: gnu-win32

Your problem has to do with the way that parent and child processes 
relate to one another.  The way that you have tested you are creating a 
child process.  The parent will not inherit the environment of the 
child.  If you want the parent to obtain the changes in the environment 
you must use "source ~/.bashrc".

Hope this helps

-        \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd@hotmail.com-
------ooo0O--O0ooo-------

Check out these great gnu-win32 related sites:
ftp://ftp.cygnus.com/pub/gnu-win32/latest/           (ftp site)
http://www.cygnus.com/pubs/gnupro/                   (Comercial Page)
http://www.cygnus.com/misc/gnu-win32/                (Project Page)
http://www.cygnus.com/ml/gnu-win32                   (Mail Archives)
http://www.itribe.net/virtunix/winhelp-man-pages/    (HTML Man Pages)
http://www.lexa.ru/sos                               (Sergey Okhapkin)
ftp://www.lexa.ru/pub/domestic/sos/                (Sergey's ftp site)
http://www.fu.is.saga-u.ac.jp/~colin/gcc.html        (Colin Peters)
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ (Mumit Khan)
http://gnu-win32.paranoia.ru                   (Chuck Bogorad's ports)
ftp://ftp.deninc.com/pub (Den Internet Services - US mirror and ports)
http://www.bestweb.net/~aka/gnu-win32/  (GNU-Win32 Bash Configuration)

>Date: 	Thu, 15 Jan 1998 18:46:06 +0200
>From: "Juha =?ISO-8859-1?Q?J=E4ykk=E4"?= <juolja@utu.fi>
>Reply-To: juolja@utu.fi
>To: gnu-win32 <gnu-win32@cygnus.com>
>Subject: .BASHRC-problem
>
>As this problem is not discussed in any of the www-help pages (that I 
cou=
>ld
>find) and I couldn't find it in archives too, I'd like to ask it here.
>  I keep losing my environment variables I set within my .bashrc. A
>screenshot of the situation may clarify this. Here you go:
>--clip--
>juhaj@IO 18:20:22 /obj>echo $PATH
>/bin
>juhaj@IO 18:20:26 /obj>cat ~/.bashrc
>#!/bin/sh.exe
>PATH=3D$PATH:/home/juhaj/bin
>export PATH
>echo Test: $PATH
>juhaj@IO 18:20:35 /obj>~/.bashrc
>Test: /bin://d/cygnus/b18/tcl/bin:/home/juhaj/bin
>juhaj@IO 18:20:42 /obj>echo $PATH
>/bin
>juhaj@IO 18:20:47 /obj>
>--clip--
>  Obviously it does not "keep" the exported variable but it also sets 
it =
>all
>wrong! Where did the "//d/cygnus/b18/tcl/bin:" part come from??? I am 
at =
>a
>total loss here. When I export variables, they should always be global, 
a=
>m I
>right? Any ideas or fixes?
>[system: NT40, intel, b18, coolview, bash-2.01]
>
>--=20
>		 -----------------------------------------------
>		| Juha J=E4ykk=E4, juolja@utu.fi			|
>		| home: http://www.utu.fi/~juolja/		|
>		| pgp-key: http://www.utu.fi/~juolja/pgp.txt	|
>		 -----------------------------------------------
>-
>For help on using this list (especially unsubscribing), send a message 
to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: .BASHRC-problem
@ 1998-01-20  0:01 Wade Richards
  0 siblings, 0 replies; 4+ messages in thread
From: Wade Richards @ 1998-01-20  0:01 UTC (permalink / raw)
  To: juolja; +Cc: gnu-win32

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2977 bytes --]

You have 2 problems here: 1) it doesn't keep the "export", and (2) it gets
the path wrong.

1) You are executing your .bashrc file in a sub-shell.  When you give the
name of a shell script on the command line (you can tell it's a shell
script by the #!), bash will execute the program specified in the #! line,
feeding in the script file.  So, the bash process that you are interacting
with starts a NEW instance of bash to run your .bashrc file.  This new,
interactive one gets its env. changed by the export PATH statement, but it
doesn't do anything to the interactive bash you are using.

To fix this problem, use ". ~/,bashrc" (note the "." command).  This tells
the interactive bash to read the file provided (~/.bashrc), and execute all
the commands in it.  This way, the export PATH statement will affect the
bash that you are interacting with.

2) I'm not quite sure where your //d/cygnus/b18/tcl/bin part came from.  If
I had to guess, I'd say that you have an /etc/profile file that does (among
other things) "export PATH=$PATH://d/cygnus/b18/tcl/bin", since your
/etc/profile file will be executed by any new shell that's created.  You
can verify this by running "bash -vx", and seeing what commands get
executed as part of the bash startup process.

           --- Wade

----------
Wade Richards    -= mailto:WRichard@Direct.CA =-
"Never attribute to malice what can adequately be explained by stupidity."

-----Original Message-----
From: Juha Jäykkä <juolja@utu.fi>
To: gnu-win32 <gnu-win32@cygnus.com>
Date: Saturday, January 17, 1998 10:54
Subject: .BASHRC-problem


As this problem is not discussed in any of the www-help pages (that I could
find) and I couldn't find it in archives too, I'd like to ask it here.
  I keep losing my environment variables I set within my .bashrc. A
screenshot of the situation may clarify this. Here you go:
--clip--
juhaj@IO 18:20:22 /obj>echo $PATH
/bin
juhaj@IO 18:20:26 /obj>cat ~/.bashrc
#!/bin/sh.exe
PATH=$PATH:/home/juhaj/bin
export PATH
echo Test: $PATH
juhaj@IO 18:20:35 /obj>~/.bashrc
Test: /bin://d/cygnus/b18/tcl/bin:/home/juhaj/bin
juhaj@IO 18:20:42 /obj>echo $PATH
/bin
juhaj@IO 18:20:47 /obj>
--clip--
  Obviously it does not "keep" the exported variable but it also sets it
all
wrong! Where did the "//d/cygnus/b18/tcl/bin:" part come from??? I am at a
total loss here. When I export variables, they should always be global, am
I
right? Any ideas or fixes?
[system: NT40, intel, b18, coolview, bash-2.01]

--
-----------------------------------------------
| Juha Jäykkä, juolja@utu.fi |
| home: http://www.utu.fi/~juolja/ |
| pgp-key: http://www.utu.fi/~juolja/pgp.txt |
-----------------------------------------------
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: .BASHRC-problem
  1998-01-15 15:16 .BASHRC-problem Juha Jäykkä
@ 1998-01-18 16:07 ` Michael Hirmke
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Hirmke @ 1998-01-18 16:07 UTC (permalink / raw)
  To: gnu-win32

Hi Juha,

[...]
>  Obviously it does not "keep" the exported variable but it also sets it all
>wrong! Where did the "//d/cygnus/b18/tcl/bin:" part come from??? I am at a
>total loss here. When I export variables, they should always be global, am I
>right? Any ideas or fixes?

Cygbus bash behaves like Unix systems do, i.e. you can only change your
current variables, if you "source" you .bashrc.
Call it with ". ~/.bashrc" and it will set your variables as you want.

>[system: NT40, intel, b18, coolview, bash-2.01]

Bye.
Michael.
--
Michael Hirmke           | Telefon +49 (911) 557999
Georg-Strobel-Strasse 81 | FAX     +49 (911) 557664
90489 Nuernberg          | E-Mail  mailto:mh@mike.franken.de
                         | WWW     http://minimike.franken.de/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* .BASHRC-problem
@ 1998-01-15 15:16 Juha Jäykkä
  1998-01-18 16:07 ` .BASHRC-problem Michael Hirmke
  0 siblings, 1 reply; 4+ messages in thread
From: Juha Jäykkä @ 1998-01-15 15:16 UTC (permalink / raw)
  To: gnu-win32

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

As this problem is not discussed in any of the www-help pages (that I could
find) and I couldn't find it in archives too, I'd like to ask it here.
  I keep losing my environment variables I set within my .bashrc. A
screenshot of the situation may clarify this. Here you go:
--clip--
juhaj@IO 18:20:22 /obj>echo $PATH
/bin
juhaj@IO 18:20:26 /obj>cat ~/.bashrc
#!/bin/sh.exe
PATH=$PATH:/home/juhaj/bin
export PATH
echo Test: $PATH
juhaj@IO 18:20:35 /obj>~/.bashrc
Test: /bin://d/cygnus/b18/tcl/bin:/home/juhaj/bin
juhaj@IO 18:20:42 /obj>echo $PATH
/bin
juhaj@IO 18:20:47 /obj>
--clip--
  Obviously it does not "keep" the exported variable but it also sets it all
wrong! Where did the "//d/cygnus/b18/tcl/bin:" part come from??? I am at a
total loss here. When I export variables, they should always be global, am I
right? Any ideas or fixes?
[system: NT40, intel, b18, coolview, bash-2.01]

-- 
		 -----------------------------------------------
		| Juha Jäykkä, juolja@utu.fi			|
		| home: http://www.utu.fi/~juolja/		|
		| pgp-key: http://www.utu.fi/~juolja/pgp.txt	|
		 -----------------------------------------------
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-01-20  0:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-19 15:26 .BASHRC-problem Earnie Boyd
  -- strict thread matches above, loose matches on Subject: below --
1998-01-20  0:01 .BASHRC-problem Wade Richards
1998-01-15 15:16 .BASHRC-problem Juha Jäykkä
1998-01-18 16:07 ` .BASHRC-problem Michael Hirmke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).