bin/80868: /bin/sh gives wrong line number of unterminated quoted
dr2867.business at pacbell.net
Tue May 10 20:40:02 GMT 2005
>Synopsis: /bin/sh gives wrong line number of unterminated quoted string error
>Arrival-Date: Tue May 10 20:40:01 GMT 2005
>Originator: Daniel Rudy
FreeBSD wildfire.danielrudy.org 5.3-RELEASE-p6 FreeBSD 5.3-RELEASE-p6 #2: Wed Mar 30 06:30:41 PST 2005 root at strata:/usr/obj/usr/src/sys/WILDFIRE i386
When using borne shell scripts (/bin/sh) and there is a coding error in the script which results in a unterminated quoted string, /bin/sh gives the wrong line number of the error.
Consider the following script:
echo "quote 1"
echo "quote 2
echo "quote 3"
echo "quote 4"
will yeild the following output:
./unquote: 6: Syntax error: Unterminated quoted string
It should be indicating that the error is on line 4, not line 6. This causes a real hassle to find a unquoted terminated string if you have a large script with many strings.
More information about the freebsd-bugs