> Date: Fri, 15 Aug 2003 14:23:06 -0400 > From: Larry Hall <[EMAIL PROTECTED]>
> To: "Dr.D.J.Picton" <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED] > 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/