Regular Expression delimiters

Larry W. Virden lwv at n8emr.UUCP
Tue Apr 11 08:44:09 AEST 1989


Using sed as a simple example of a complex situation, how would one code
a shell program to invoke sed so that the arguments passed would always be
valid ?  That is, lets say that I wanted to write a script which would read
the arguments to sed in from the keyboard.  Also, assume that I was dealing
with users who wouldnt know sed from a hole in the ground ;-0.  I want
to use delimiters around the shell variable containing their input which
wont clash:

sed -e /$ans/ filename

doesnt work - what if there are multiple /'s in the user's answer.

Using ^, !, etc - basically a hard coded printable character - have the
same problems.  

Do folks just ignore this possibility, or is there a standard trick to this?

-- 
Larry W. Virden	 674 Falls Place, Reynoldsburg, OH 43068 (614) 864-8817
75046,606 (CIS) ; LVirden (ALPE) ; osu-cis!n8emr!lwv (UUCP) 
osu-cis!n8emr!lwv at TUT.CIS.OHIO-STATE.EDU (INTERNET)
The world's not inherited from our parents, but borrowed from our children.



More information about the Comp.unix.questions mailing list