This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Various shell problems


> Date: Fri, 15 Aug 2003 14:23:06 -0400
> From: Larry Hall <cygwin-lh@cygwin.com>

> To: "Dr.D.J.Picton" <dave@aps5.ph.bham.ac.uk>
> CC: cygwin@cygwin.com
> Subject: Re: Various shell problems
> Content-Transfer-Encoding: 7bit
> x-scan-bham: no
> 
> Dr.D.J.Picton wrote:
> > 
> > 3. /bin/sh sources /etc/profile when called from ftp.exe
> > If SHELL isn't exported or is set to /bin/sh, ftp.exe uses the /bin/sh
> > shell for shell escapes.  Unfortunately the working directory of the shell
> > is then always set to the user's home directory.  Now I know why - for 
> > some reason, /bin/sh thinks it's a login shell and sources the profile. 

Here is my fix to /etc/profile to circumvent the problem.  All the code is
skipped if it detects that the profile has already been run, and argument
zero is set to "-sh":

At the start of the file:

# fix for ftp problem ...
if [ -z "$PROFILE_ALREADY_DONE" -o "$0" != "-sh" ]; then
export PROFILE_ALREADY_DONE=1

At the end of the file:

fi


--
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/


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