スクリプトが機能するのに機能し#!/bin/bash
ない理由を理解しようとしてい#!/bin/sh
ます。Cygwinと両方sh.exe
を実行していますが、bash.exe
同じ(同じファイルサイズ)のようです。
$ cat 1.sh
#!/bin/sh
while read line; do
echo ${line:0:9}
done < <(help | head -5)
$ ./1.sh
./1.sh: line 4: syntax error near unexpected token `<'
./1.sh: line 4: `done < <(help | head -5)'
$ cat 2.sh
#!/bin/bash
while read line; do
echo ${line:0:9}
done < <(help | head -5)
$ ./2.sh
GNU bash,
These she
Type `hel
Use `info
Use `man