Path: utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!EFD.LTH.SE!perf From: perf@EFD.LTH.SE Newsgroups: gnu.bash.bug Subject: Whitespace not skipped in continued case pattern Message-ID: <8907021738.AA08996@osiris.efd.lth.se> Date: 2 Jul 89 17:38:25 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 65 Facts: Bash 1.01 compiled with gcc 1.35 on a Sun 3/280 running SunOS 4.0.1 A newline in a case pattern seems to turn off skipping of whitespace in the continuing line. Some examples: --------------------------------- This doesn't work at all. bash$ cat test1.sh case $SHELL in *csh | *ksh |\ *bash ) echo xxxxxxxx ;; esac bash$ sh test1.sh xxxxxxxx bash$ bash -norc test1.sh syntax error near `*bash' in line 3: ` *bash )' syntax error near `;' in line 4: ` echo xxxxxxxx ;;' syntax error near `esac' in line 5: `esac' --------------------------------- But if we break the line before the '|' it's ok. bash$ cat test2.sh case $SHELL in *csh | *ksh\ | *bash ) echo xxxxxxxx ;; esac bash$ sh test2.sh xxxxxxxx bash$ bash -norc test2.sh xxxxxxxx --------------------------------- Then put a blank before '\' and we're lost again... bash$ cat test3.sh case $SHELL in *csh | *ksh \ | *bash ) echo xxxxxxxx ;; esac bash$ sh test3.sh xxxxxxxx bash$ bash -norc test3.sh in line 3: ` | *bash )' syntax error near `;' in line 4: ` echo xxxxxxxx ;;' syntax error near `esac' in line 5: `esac' --------------------------------- Note that sh has no problems with any of the examples. -- Per Foreby System manager at EFD, Lund Institute of Technology (Lund University) Snail: E-huset, Tekniska Hogskolan i Lund, Box 118, S-221 00 LUND, Sweden. Email: perf@efd.lth.se Phone: int + 46 46-10 75 98