I hate asking this question, but Bash is fooling me again. Some days ago, the following SH file worked perfectly:
declare DONE=
declare -i i=0
until [ $DONE ]; do
IFS= read -r line || DONE=1
(( i++ ))
echo "$line"
done < <( cat "$1" )
echo "$i lines!"
But today I get this error (passing a file as argument $1
):
readline.sh: line 16: syntax error near unexpected token `<'
readline.sh: line 16: `done < <( cat "$1" )'
What has happened?