/etc/profile.d/lilypond-profile.sh and basename
Wheeler, Frederick W (Research)
wheeler@crd.ge.com
Thu Mar 10 14:55:00 GMT 2005
In Cygwin, when I ssh to my machine, I get the following error from basename
% ssh d1
Last login: Thu Mar 10 08:54:40 2005 from caleb.crd.ge.com
basename: invalid option -- b
Try `basename --help' for more information.
-bash: [: too many arguments
%
I've traced this into /etc/profile.d/lilypond-profile.sh. On line 25 we see
basename "$0"
which becomes
basename "-bash"
and gives the error. Perhaps this resulted from a change in basename behavior in the recent coreutils update? I'm not sure.
21 echo "Continuing anyway ..."
22 return 2
23 fi
24
25 if [ -z "$ZSH_NAME" -a `basename "$0"` = "lilypond-profile" ] ; then
26 cat >/dev/stderr <<EOF
27
28 Error: This script cannot be run in a subshell; it MUST be sourced.
29
30
Changing line 25 to this
25 if [ -z "$ZSH_NAME" -a `basename "/$0"` = "lilypond-profile" ] ; then
seems to work for me. Now
basename "/$0"
which becomes
basename "/-bash"
and basename prints "-bash" and everything seems to work OK. I'm not sure what all the implications are though. For example, if $0 is "", then basename "/$0" is basename "/" which produced "/". That might be OK for the purposes of this script.
I've attached "cygcheck -s -v -r > cygcheck.out". I did a complete setup.exe update this morning.
Fred Wheeler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 237641 bytes
Desc: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050310/f664e4f0/attachment.obj>
-------------- next part --------------
--
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