#!/bin/sh and #!/bin/bash is not the same

Morten Kjærulff mortenkjarulff@gmail.com
Sat Aug 20 21:32:00 GMT 2016


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



More information about the Cygwin mailing list