This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: __[[__ operator in bash ?
- To: Jean-Paul dot Gabrielli at sema dot fr
- Subject: Re: __[[__ operator in bash ?
- From: Bob McGowan <Robert dot McGowan at veritas dot com>
- Date: Tue, 08 Feb 2000 09:47:14 -0800
- CC: cygwin at sourceware dot cygnus dot com
- Organization: VERITAS Software
- References: <000701bf7243$c0fa2ee0$8b01010a@volga.sophia.sema.fr>
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