From owner-freebsd-questions@FreeBSD.ORG Sat Nov 6 16:45:20 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2239716A4CE for ; Sat, 6 Nov 2004 16:45:20 +0000 (GMT) Received: from smtp.prodigy.net.mx (nlpproxy10.prodigy.net.mx [148.235.52.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9826143D31 for ; Sat, 6 Nov 2004 16:45:19 +0000 (GMT) (envelope-from mapsware@prodigy.net.mx) Received: from smtp.prodigy.net.mx (nlpproxy10 [148.235.52.30]) by smtp.prodigy.net.mx (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0I6R00MPWNUQ46@smtp.prodigy.net.mx>; Sat, 06 Nov 2004 10:44:51 -0600 (CST) Received: from[201.128.224.23])(built Sep 8 2003))with ESMTP id <0I6R00MVNNUPDX@smtp.prodigy.net.mx>; Sat, 06 Nov 2004 10:44:50 -0600 (CST) Date: Sat, 06 Nov 2004 09:45:17 -0700 From: Martin Paredes To: freebsd-questions@freebsd.org Message-id: <200411060945.17767.mapsware@prodigy.net.mx> Organization: MAPSware MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable Content-disposition: inline User-Agent: KMail/1.5.4 X-imss-version: 2.11 X-imss-result: Passed X-imss-scores: Clean:22.18736 C:21 M:2 S:5 R:5 X-imss-settings: Baseline:3 C:2 M:2 S:2 R:2 (0.5000 1.0000) Subject: find printers with problems X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Nov 2004 16:45:20 -0000 Hi listers. I need to make a script to find the printers with problems, "queuing is=20 disabled" or "printing is disabled", but the problem is how the lpc command= =20 print the information. # lpc status all prtsin2114: =A0 =A0 =A0 =A0 queuing is enabled =A0 =A0 =A0 =A0 printing is enabled =A0 =A0 =A0 =A0 1 entry in spool area =A0 =A0 =A0 =A0 printer idle prtsin2111: =A0 =A0 =A0 =A0 queuing is disabled =A0 =A0 =A0 =A0 printing is enabled =A0 =A0 =A0 =A0 no entries in spool area =A0 =A0 =A0 =A0 printer idle prtsin2112: =A0 =A0 =A0 =A0 queuing is enabled =A0 =A0 =A0 =A0 printing is disabled =A0 =A0 =A0 =A0 no entries in spool area =A0 =A0 =A0 =A0 printer idle prtsin2113: =A0 =A0 =A0 =A0 queuing is enabled =A0 =A0 =A0 =A0 printing is enabled =A0 =A0 =A0 =A0 no entries in spool area =A0 =A0 =A0 =A0 printer idle I had been trying to use awk, sed and grep to produce something like : prtsin2111::queuing is disabled:printing is enabled prtsin2112::queuing is enabled:printing is disabled but my problem is how to substitute the string (new line and tab) "\n\t" by= =20 ":". TIA maps