Regular Expression delimiters

Dan Bernstein bernsten at phoenix.Princeton.EDU
Fri Apr 14 03:33:29 AEST 1989


In article <7702 at phoenix.Princeton.EDU> I write:
> It wouldn't take much work to make a `literal' alias,

so I'll now put my money where my mouth is.

  alias literal 'sed '\''s-\([\.\*\[\\\^\$\/]\)-\\\1-g'\'
  alias show 'echo "$\!:1"'

The acid test, of course, is

  show ans | sed "s/`show ans | literal`/xxx/g"

which, no matter what $ans is, will output xxx.

If your csh doesn't have a working builtin echo, you'll have to rewrite
show along the lines of my previous article.

---Dan Bernstein, bernsten at phoenix.princeton.edu



More information about the Comp.unix.questions mailing list