This is the mail archive of the
cygwin
mailing list for the Cygwin project.
#!/bin/sh and #!/bin/bash is not the same
- From: Morten Kjærulff <mortenkjarulff at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 20 Aug 2016 19:42:20 +0200
- Subject: #!/bin/sh and #!/bin/bash is not the same
- Authentication-results: sourceware.org; auth=none
Hi,
I thought that #!/bin/sh in a script would be a bash, but it seems not
to be - or what am I doing wrong?
vp01mkf@DX305 ~/bin
$ cat ./tsh.sh
#!/bin/sh
cat < <(pwd)
vp01mkf@DX305 ~/bin
$ ./tsh.sh
./tsh.sh: line 3: syntax error near unexpected token `<'
./tsh.sh: line 3: `cat < <(pwd)'
vp01mkf@DX305 ~/bin
$ cat ./tbash.sh
#!/bin/bash
cat < <(pwd)
vp01mkf@DX305 ~/bin
$ ./tbash.sh
/home/vp01mkf/bin
vp01mkf@DX305 ~/bin
$ diff tsh.sh tbash.sh
1c1
< #!/bin/sh
---
> #!/bin/bash
vp01mkf@DX305 ~/bin
$ ls -l /bin/sh /bin/bash
-rwxr-xr-x 1 vp01mkf Domain Users 757277 Aug 6 14:56 /bin/bash
-rwxr-xr-x 1 vp01mkf Domain Users 757277 Aug 6 14:56 /bin/sh
vp01mkf@DX305 ~/bin
$
/Morten
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple