Subject: Re: Latest uopdates to bash and ash, 20050707
From: "fergus" <[email-masked]>
To: <[email-masked]>
Cc: <[email-masked]>
Date: Thu, 7 Jul 2005 14:17:59 +0100

Thanks for getting back so quickly.
Sorry about annoying typo in Subject.
(1) and (2) answer your qq. Please see also (3).

(1) I installed using setup, selecting everything (including source). I
always update using setup.

(2) There is no /bin/sh.exe.

cat /var/log/setup.log reveals postinstall scripts are called 00bash.sh and
00ash.sh but don't suppose that matters?

Here are _contents_ of 00*sh.done (hope that's what you were asking):

/etc/postinstall> cat 00ash.sh.done 
#!/bin/ash
# Ash postinstall script.  This ensures that /bin/sh exists and is
# runnable, favoring bash, and updating only if it is missing or ash
update=no
# Is /bin/sh missing, or have broken dependencies?
case `(cygcheck /bin/sh.exe) 2>&1` in
    *Error:\ could\ not\ find*) update=yes ;;
    *) # We can run it.  Is the version from ash?
        case `(/bin/sh.exe --version) 2>&1` in
            Illegal\ option\ --*) update=yes ;;
        esac ;;
esac
# Update, if needed.
if test $update = yes ; then
   cp -f /bin/bash.exe /bin/sh.exe || cp -f /bin/ash.exe /bin/sh.exe
fi 

... and ...

/etc/postinstall> cat 00bash.sh.done 
#!/bin/bash
# Bash postinstall script.  This ensures that /bin/sh exists and is
# runnable, updating older copies of ash or bash as appropriate, while
# leaving other shells (ksh or zsh) alone.
# Get rid of ash manpage, if it is in the way of our compressed page.
rm -f /usr/share/man/man1/sh.1
update=no
# Is /bin/sh missing, or have broken dependencies?
case `cygcheck /bin/sh.exe 2>&1` in
    *Error:\ could\ not\ find*) update=yes ;;
    *) # We can run it.  Is the version from ash or bash?
        case `/bin/sh.exe --version 2>&1` in
            Illegal\ option\ --* | GNU\ bash*) update=yes ;;
        esac ;;
esac
# Update, if needed.  Use copy, not hard or symlink, since symlinks won't
# work from Windows cmd and a hardlink to a running shell can't be broken.
# As a last-ditch fallback, try exec to stop running bash.
if test $update = yes ; then
    cp -f /bin/bash.exe /bin/sh.exe || exec cp -f /bin/bash.exe /bin/sh.exe
fi

(3) But when I actually run them, there's nothing echoed to screen. Nor is
any copy of nbash.exe created.

Thanks,

Fergus

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