Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!osu-cis!n8emr!lwv From: lwv@n8emr.UUCP (Larry W. Virden) Newsgroups: comp.unix.questions Subject: Regular Expression delimiters Message-ID: <993@n8emr.UUCP> Date: 10 Apr 89 22:44:09 GMT Reply-To: lwv@n8emr.UUCP (Larry W. Virden) Organization: Ham BBS, 614-457-4227 (1200/2400/19.2 telebit,8N1) Lines: 23 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@TUT.CIS.OHIO-STATE.EDU (INTERNET) The world's not inherited from our parents, but borrowed from our children.