delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/07/15:45:15

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <404B89C5.2090504@paulgalbraith.net>
Date: Sun, 07 Mar 2004 15:44:53 -0500
From: Paul Galbraith <paul AT paulgalbraith DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
MIME-Version: 1.0
To: Karl M <karlm30 AT hotmail DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: Patch for problems with profile script in Win9x
References: <BAY10-F84sA7MnuXoKE0000430e AT hotmail DOT com>
In-Reply-To: <BAY10-F84sA7MnuXoKE0000430e@hotmail.com>
Note-from-DJ: This may be spam

That's purely a function of my shell scripting abilities...you're way 
seems a lot easier!

Karl M wrote:
> Hi Paul...
> 
> Why not just do something like
> 
> case $(echo $0 | tr [:upper:] [:lower:]) in
> 
> instead of
> 
> case $0 in
> 
> ? It seems easier.
> 
> Thanks,
> 
> ...Karl
> 
>> From: "Paul Galbraith"
>> To: <cygwin AT cygwin DOT com>
>> Subject: Patch for problems with profile script in Win9x
>> Date: Sun, 7 Mar 2004 11:04:26 -0500
>>
>> It seems that the default profile script checks what shell the user is
>> running and sets appropriate defaults based on the shell.  
>> Unfortunately, on
>> all Win9x installs that I've done recently, I've noticed that the profile
>> isn't correctly identifying that bash is my shell (which it indeed 
>> is).  The
>> problem seems to be that $0 is set to 'BASH', whereas the script is 
>> testing
>> for 'bash'.  The following changes to /etc/profile fix things up for me.
>>
>> I know that /etc/profile comes from the base-files package, but I 
>> don't know
>> where the source is located for that package...perhaps someone more
>> knowledgeable than I can submit this patch to the appropriate place?
>> Thanks!
>>
>> Paul
>>
>> ----------
>>
>> --- /etc/profile.orig 2004-03-07 10:03:26.000000000 -0500
>> +++ /etc/profile 2004-03-07 10:24:12.000000000 -0500
>> @@ -78,7 +78,11 @@
>>  # export CVSROOT
>>
>>  # Shell dependent settings
>> -case "$0" in
>> +SHELLNAME_TMP1=`mktemp`
>> +SHELLNAME_TMP2=`mktemp`
>> +echo $0 > $SHELLNAME_TMP1
>> +tr [:upper:] [:lower:] < $SHELLNAME_TMP1 > $SHELLNAME_TMP2
>> +case `cat $SHELLNAME_TMP2` in
>>  bash     | -bash     | */bash | \
>>  bash.exe | -bash.exe | */bash.exe )
>>   # Set a HOSTNAME variable
>> @@ -122,6 +126,8 @@
>>   PS1='$ '
>>   ;;
>>  esac
>> +rm $SHELLNAME_TMP1
>> +rm $SHELLNAME_TMP2
>>
>>  export PS1
>>
>>
>>
>>
>> ---
>> Outgoing mail is certified Virus Free.
>> Checked by AVG anti-virus system (http://www.grisoft.com).
>> Version: 6.0.594 / Virus Database: 377 - Release Date: 24/02/04
>>
>>
>> -- 
>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>> Problem reports:       http://cygwin.com/problems.html
>> Documentation:         http://cygwin.com/docs.html
>> FAQ:                   http://cygwin.com/faq/
>>
> 
> _________________________________________________________________
> Fast. Reliable. Get MSN 9 Dial-up - 3 months for the price of 1! 
> (Limited-time Offer) 
> http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019