public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Bash Environment (Was: Bash history?)
@ 1997-09-16 21:51 Wei Ku
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Ku @ 1997-09-16 21:51 UTC (permalink / raw)
  To: Michael A. Chase, gnu-win32

 Only th login shell will read the .bash_profile. To run bash as a login
shell try:
bash -login

Wei ku


-----Original Message-----
From: Michael A. Chase <mchase@ix.netcom.com>
To: Sergey Okhapkin <sos@prospect.com.ru>; gnu-win32@cygnus.com
<gnu-win32@cygnus.com>; 'Andy Piper' <andyp@parallax.co.uk>
Date: Tuesday, September 16, 1997 8:49 PM
Subject: Bash Environment (Was: Bash history?)



>I have similar problems.  It appears that the only environment variable
>that gets changed from MSDOS form to UNIX form is $PATH.  All the others
>keep their backslashes and semicolons.
>
>I put code in /etc/profile to fix the environment (attached).
>Unfortunately, I have never seen /etc/profile run by default so I added a
>check for it to .bashrc (which does work) to run both /etc/profile and
>.bash_profile.
>
>Is there something else I should be doing to get the correct environment
>at bash startup?
>
>Mac :})
>-----Original Message-----
>From: Sergey Okhapkin <sos@prospect.com.ru>
>To: gnu-win32@cygnus.com <gnu-win32@cygnus.com>; 'Andy Piper'
><andyp@parallax.co.uk>
>Date: Sunday, September 07, 1997 22:02
>Subject: RE: Bash history?
>
>
>
>>Andy Piper wrote:
>>> 1) ~ seems to be interpreted wrongly. If I do `cd ~' I get:
>>> bash.exe: C:WINNTProfilesandyp: No such file or directory
>>> cd $HOME works fine. Somehow the /'s are getting stripped out.
>>
>>I'm sure, there are backslashes instead of slashes in your HOME env.
>var. Set HOME to
>>c:/WINNT/Profiles/andyp.
>>
>>>
>>> 2) History is not preserved between sessions. Although bash
>>> writes out a history file - .bash_history - correctly. It is not read
>when
>>
>>Fix the first problem, and the second one should came out.
>>
>>--
>>Sergey Okhapkin, http://www.lexa.ru/sos
>>Moscow, Russia
>>Looking for a job
>
>

-
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: Bash Environment (Was: Bash history?)
@ 1997-09-19  6:52 Michael A. Chase
  0 siblings, 0 replies; 4+ messages in thread
From: Michael A. Chase @ 1997-09-19  6:52 UTC (permalink / raw)
  To: Wei Ku, gnu-win32

I knew that.  Unfortunately, I also 'knew' that the first shell would
mystically know it was the login shell.

I added -login to my startup commands and /etc/profile and
~/.bash_profile now get called automatically.

Sadly, the environment variables (except for $PATH) are still not getting
converted until I do it in /etc/profile.

Thanks,
Mac :})
-----Original Message-----
From: Wei Ku <weiku@utkux.utcc.utk.edu>
To: Michael A. Chase <mchase@ix.netcom.com>; gnu-win32@cygnus.com
<gnu-win32@cygnus.com>
Date: Tuesday, September 16, 1997 21:51
Subject: Re: Bash Environment (Was: Bash history?)



> Only the login shell will read the .bash_profile. To run bash as a
login
>shell try:
>bash -login


-
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: Bash Environment (Was: Bash history?)
@ 1997-09-18  6:23 Michael A. Chase
  0 siblings, 0 replies; 4+ messages in thread
From: Michael A. Chase @ 1997-09-18  6:23 UTC (permalink / raw)
  To: Larry Hall, gnu-win32

Thanks.  I'd thought I'd accidentally erased the necessary entries in my
registry, but you don't have any either.  I think my next step will be to
re-install Cygwin32 and Sergey's latest coolview and see if that fixes my
problem.

-----Original Message-----
From: Larry Hall <lhall@rfk.com>
To: Michael A. Chase <mchase@ix.netcom.com>
Date: Wednesday, September 17, 1997 17:44
Subject: Re: Bash Environment (Was: Bash history?)



>At 06:29 AM 9/17/97 -0700, you wrote:
>>I must have something different in my registry or environment.
>>
>>Please send me a dump of your environment and registry (from
>>'HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions' and
>>'HKEY_CURRENT_USER\Software\Cygnus Solutions').  Feel free to trim out
>>parts you consider sensitive.  If those are the wrong places, I'd be
glad
>>to hear that, too.
>>-----Original Message-----
>>From: Larry Hall (RFK Partners Inc) <lhall@rfk.com>
>>To: Michael A. Chase <mchase@ix.netcom.com>
>>Date: Tuesday, September 16, 1997 10:25
>>Subject: Re: Bash Environment (Was: Bash history?)
>>
>>>At 06:45 PM 9/15/97 -0700, you wrote:
>>>>I have similar problems.  It appears that the only environment
variable
>>>>that gets changed from MSDOS form to UNIX form is $PATH.  All the
>>others
>>>>keep their backslashes and semicolons.
>>>
>>>I used to have this problem with b17 but it disappeared in b18 for
>>me....
>
>OK, here it is.  I don't know why there is a b18 key under
>HKEY_LOCAL_MACHINE.


-
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

* Bash Environment (Was: Bash history?)
@ 1997-09-16  6:16 Michael A. Chase
  0 siblings, 0 replies; 4+ messages in thread
From: Michael A. Chase @ 1997-09-16  6:16 UTC (permalink / raw)
  To: Sergey Okhapkin, gnu-win32, 'Andy Piper'

[-- Attachment #1: Type: text/plain, Size: 1347 bytes --]

I have similar problems.  It appears that the only environment variable
that gets changed from MSDOS form to UNIX form is $PATH.  All the others
keep their backslashes and semicolons.

I put code in /etc/profile to fix the environment (attached).
Unfortunately, I have never seen /etc/profile run by default so I added a
check for it to .bashrc (which does work) to run both /etc/profile and
.bash_profile.

Is there something else I should be doing to get the correct environment
at bash startup?

Mac :})
-----Original Message-----
From: Sergey Okhapkin <sos@prospect.com.ru>
To: gnu-win32@cygnus.com <gnu-win32@cygnus.com>; 'Andy Piper'
<andyp@parallax.co.uk>
Date: Sunday, September 07, 1997 22:02
Subject: RE: Bash history?



>Andy Piper wrote:
>> 1) ~ seems to be interpreted wrongly. If I do `cd ~' I get:
>> bash.exe: C:WINNTProfilesandyp: No such file or directory
>> cd $HOME works fine. Somehow the /'s are getting stripped out.
>
>I'm sure, there are backslashes instead of slashes in your HOME env.
var. Set HOME to
>c:/WINNT/Profiles/andyp.
>
>>
>> 2) History is not preserved between sessions. Although bash
>> writes out a history file - .bash_history - correctly. It is not read
when
>
>Fix the first problem, and the second one should came out.
>
>--
>Sergey Okhapkin, http://www.lexa.ru/sos
>Moscow, Russia
>Looking for a job


[-- Attachment #2: profile --]
[-- Type: text/plain, Size: 1102 bytes --]


if [ ${_ETC_PROFILE_:=0} = 0 ]; then
   export _ETC_PROFILE_=1

   if [ $(env | grep ';' | wc -c) -ne 0 ]; then
      echo "Fixing env"
      # Add 'UNIX' executable directories and remove windows ones
      PATH="/usr/local/bin:/bin:/usr/bin:/bin:$PATH"
      PATH=`echo "$PATH" | sed -e 's,:/perl5.004.bc/bin,,;s,:/wbin,,g'`

      # Convert DOS backslashes, drives, and path separators in environment to UNIX
      # 1. Don't touch PATH
      # 2. Don't lines starting with punctuation !_@#%^&*()=+:;<>?/`~-
      # 3. Backslash -> slash
      # 4. C:/ -> / and C:  -> /
      # 5. DRIVE: -> /DRIVE
      # 6. ; -> :
      # 7. Quote values

      tfile=/tmp/profile.$$
      env | \
         sed -e '/^$/d;/^PATH=/d' \
             -e '/^[!_@#%^&*()=+:;<>?/`~-]/d' \
             -e 's,\\,/,g' \
             -e 's,[Cc]:/,/,g' -e 's,[Cc]:,/,g' \
             -e 's,\([a-zA-Z]\):,//\1/,g' \
             -e 's,;,:,g' \
             -e "s/^\([^=][^=]*=\)\(.*\)$/\1'\2'/" > $tfile
      source $tfile
      rm $tfile
   fi

   # Other shell initialization stuff
   export TERM=linux
   set -o vi
fi


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

end of thread, other threads:[~1997-09-19  6:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-16 21:51 Bash Environment (Was: Bash history?) Wei Ku
  -- strict thread matches above, loose matches on Subject: below --
1997-09-19  6:52 Michael A. Chase
1997-09-18  6:23 Michael A. Chase
1997-09-16  6:16 Michael A. Chase

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).