From owner-freebsd-hackers Sat Nov 16 23:57:27 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 435AD37B401 for ; Sat, 16 Nov 2002 23:57:26 -0800 (PST) Received: from gw.gbch.net (gw.gbch.net [203.143.238.93]) by mx1.FreeBSD.org (Postfix) with SMTP id 1D9C343E3B for ; Sat, 16 Nov 2002 23:57:23 -0800 (PST) (envelope-from gjb@gbch.net) Received: (qmail 91160 invoked by uid 1001); 17 Nov 2002 17:57:20 +1000 X-Posted-By: GJB-Post 2.29 08-Nov-2002 X-Operating-System: FreeBSD 4.2-RELEASE i386 X-Uptime: 136 days, 23:54 X-Location: Brisbane, Australia; 27.49841S 152.98439E X-URL: http://www.gbch.net/gjb.html X-Image-URL: http://www.gbch.net/gjb/gjb-auug048.gif X-GPG-Fingerprint: EBB2 2A92 A79D 1533 AC00 3C46 5D83 B6FB 4B04 B7D6 X-PGP-Public-Keys: http://www.gbch.net/keys.html Message-Id: Date: Sun, 17 Nov 2002 17:57:20 +1000 From: Greg Black To: Lyndon Nerenberg Cc: freebsd-hackers@freebsd.org Subject: Re: finding unmatched quotes in shell scripts References: <200211170159.gAH1xCG1052133@orthanc.ab.ca> In-reply-to: <200211170159.gAH1xCG1052133@orthanc.ab.ca> of Sat, 16 Nov 2002 18:59:12 MST Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Lyndon Nerenberg wrote: | I've tried a number of syntax-colouring editors, to no avail. The quotes | (single, double, and back) *are* balanced, according to everything I've | thrown the script at. That's why I'm more interested in something that | can actually parse Bourne shell syntax (quiet Terry - I *know* what | you're going to say) and dump out what it thinks the parse tree looks | like. The problem isn't with the quotes being unbalanced, it's something | else that's making the shell ignore one (or more) of those quotes. Surely the simple thing is to put an exit statement in the middle of the script and see which half has the problem? Move the exit statement forwards or backwards in a binary search until the problem leaps out and hits you in the face. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message