*BSD News Article 35931


Return to BSD News archive

Xref: sserve comp.unix.user-friendly:2885 comp.unix.solaris:23441 comp.unix.programmer:20181 comp.unix.misc:13970 comp.unix.aux:15655 comp.unix.bsd:14912 comp.unix.aix:44470
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!news.Hawaii.Edu!ames!hookup!swrinde!howland.reston.ans.net!europa.eng.gtefsd.com!news.umbc.edu!haven.umd.edu!nova.umd.edu!nova!rockwell
From: rockwell@nova.umd.edu (Raul Deluth Miller)
Newsgroups: comp.unix.user-friendly,comp.unix.solaris,comp.unix.programmer,comp.unix.misc,comp.unix.aux,comp.unix.bsd,comp.unix.aix
Subject: Re: Shell wars
Date: 8 Sep 1994 12:24:45 -0400
Organization: University of Maryland University College
Lines: 22
Distribution: inet
Message-ID: <ROCKWELL.94Sep8122444@nova.umd.edu>
References: <33af70$8rd@usenet.INS.CWRU.Edu> <ROCKWELL.94Sep4164530@nova.umd.edu>
	<34eppt$919@sprocket.csv.warwick.ac.uk>
	<ROCKWELL.94Sep5125341@nova.umd.edu>
	<34n4ps$mg2@sprocket.csv.warwick.ac.uk>
NNTP-Posting-Host: nova.umd.edu
In-reply-to: cudcv@csv.warwick.ac.uk's message of 8 Sep 1994 14:49:48 +0100

Raul Miller:
. >. >eval lpr `set | egrep \^lpargs | cut -d= -f2- | while read l; do echo
. >. >   \"$l\"; done`

Rob McMahon:
. It doesn't work with "s in the variables, though...

Ok, to deal with ", ', $ and \, I'd build myself a file named
unesc.sed, with the contents:
s/\\/\\\\/g
s/'/\\'/g

Then, I'd do something like:

eval lpr `set | egrep \^lpargs | sed -f unesc.sed |
   cut -d= -f2- | while read l; do echo \'$l\'; done`

I'd definitely put this one in a script file, even if I only did it
once. 

Raul D. Miller
<rockwell@nova.umd.edu>