Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: <200308160900.KAA26421@aps5.ph.bham.ac.uk> Date: Sat, 16 Aug 2003 09:58:54 +0100 (BST) From: "Dr.D.J.Picton" Reply-To: "Dr.D.J.Picton" Subject: Re: Various shell problems To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: HA/qKW+Mm9jPhwtyypbuGA== > Date: Fri, 15 Aug 2003 14:23:06 -0400 > From: Larry Hall > To: "Dr.D.J.Picton" > CC: cygwin AT cygwin DOT 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/