🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #196

Whitespace not skipped in continued case pattern

#196
From: perf
Date: Sun, 02 Jul 1989 17:38
65 lines
1919 bytes
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
Technical Details
Message-ID: <8907021738.AA08996@osiris.efd.lth.se>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!EFD.LTH.SE!perf

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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