Various shell problems

Dr.D.J.Picton dave@aps5.ph.bham.ac.uk
Sat Aug 16 10:40:00 GMT 2003


> Date: 2003年8月15日 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/


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /