This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Possible bash incompatibility


Hi all,

Could someone tell me why the piece of bash script below is being
rejected as being erroneous on cygwin but works fine on other bash's
ie: linux and openbsd?

my current version of bash is update (2.05b).


#!/bin/bash


if [ `uname -s | grep -c 'CYGWIN'` -eq "1" ]; then
printf "Target platform is Win32 via CYGWIN\n";
else
printf "Target platform is NOT Win32 via CYGWIN\n";
fi



error message:
bash-2.05b$ ./test.sh
./test.sh: line 3: [: too many arguments
Target platform is NOT Win32 via CYGWIN
bash-2.05b$




Regards




Arash Partow
__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]