__[[__ operator in bash ?
Bob McGowan
Robert.McGowan@veritas.com
Tue Feb 8 09:43:00 GMT 2000
Jean-Paul,
When you copied bash.exe to /usr/bin, did you name it sh.exe? If not,
you can rename it, or change the script so it begins with
#!/usr/bin/bash or you can make a symbolic link to bash named sh:
cd /usr/bin
ln -s bash.exe sh
Any of these should give you the bash environment that recognizes the [[
... ]] syntax. There is an sh.exe in /bin that you may want to rename
to ash.exe and make a link or copy of bash.exe named sh there as well.
You could, if you like, completely remove the bash.exe from /usr/bin and
change the link command as follows:
ln -s /bin/bash.exe sh
being sure you are in /usr/bin when you run it.
Bob
Jean-Paul Gabrielli wrote:
>
> Hi,
>
> What to put as first line (#!) to give bash the 'posix' behavior ?
> I did a copy of bash under /usr/bin for portability reasons
>
> When I got the following script:
> #!/usr/bin/sh
> if [[ -d /winnt ]] ; then
> echo "Found Folder!"
> fi
>
> jpgnt-tstvsn9 > test.shl
> [[: not found
> jpgnt-tstvsn9 > bash test.shl
> Found Folder!
>
> Thanks for helping
> j-paul gabrielli
> sema dts
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
--
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
More information about the Cygwin
mailing list