Mike Frysinger wrote: > code that uses case statements in a subshell and then uses comments causes > bash to trigger a parsing error: > $ cat test.sh > echo $(case a in (a) echo ok ;; # comment > ) > $ sh ./test.sh > ./test.sh: line 1: unexpected EOF while looking for matching `)' > ./test.sh: line 3: syntax error: unexpected end of file
As well it should. Bash parses the contents of command substitutions, so it will look forever for the missing `esac'. The error message could be improved. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/