It's quite common to forget an end quote when writing shell programs. Only when you execute it do you get a cryptic message (shown below) that you've forgotten an end quote. The error message always points to the end of the script file, not the line where the quote started. This "MissingEndQuote.ksh" script is the answer to this rpoblem.
line 103: unexpected EOF while looking for matching `"'
"MissingEndQuote.ksh" parses the script file you pass in as a command-line argument. It searches for begin single-quote, double-quote, and back-quote that does not have a end quote. And then it output the offending line number and the line of code. The only catch is that begin and end quotes must be on the same line.
"MissingEndQuote.ksh" takes advantage of the IsOdd.sh (GPL) script and the SubString (Freeware) Java software, which are also available on this site. So to use this script, you will need to download these other two programs if you don't already have them.
"MissingEndQuote.ksh" is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.
"MissingEndQuote.ksh" executes quite slowly, because it needs to extract each character to count. There is no easy way to extract characters in a shell script, so that it is forced to call SubString. I thought, perhaps, that loading the Java interpreter was slowing it down. So I implemented SubStr.sh recently, using grep to extract the characters. But it turned out that SubStr.sh was even slower than SubString. The following are the time stamps of running each version of "MissingEndQuote.ksh".
# using Java SubString
It turned out that using Java SubString is three times faster than using SubStr.sh. If you know an even faster way to speed up "MissingEndQuote.ksh", please let us know, because so far, I found this utility to be quite useful.
On a happier note, I have made changes to "MissingEndQuote.ksh" so that it shows progress output. It's a lot easier to wait for "MissingEndQuote.ksh" to finish if you have an idea where it's at. The newer version of "MissingEndQuote.ksh" is attached below.
Did your message disappear? Read the Forums FAQ.
Spam Control | * indicates required field
TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.
No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.
Messages, files, and images copyright by respective owners.
23 Users Online
Copyright © 1996 - 2021. All Rights Reserved.