On Tue, 2002-12-03 at 14:54, Shaw, Marco wrote:
> >From a script: main.sh, I need to:
> 1. Copy file ./x to /tmp/x
> 2. Read a variable from stdin, for example: read VALUE
> 3. Search through file /tmp/x for the keyword REPLACE, and replace it with ${VALUE}
> 
> I can't seem to figure out what combination of sed, perl, whatever I can use.
> 
> Marco
> 
> main.sh:
> #!/bin/sh
> 
> cp ./x /tmp/x
> read VALUE
> 
> # what I really want, but doesn't work:
> sed 's/REPLACE/${VALUE}/g' /tmp/x > /tmp/x.new
> 



You don't say what is wrong but I don't think that ${VALUE} will be
expanded in the single quotes.  Is REPLACE being replaced with the value
entered or with ${VALUE} ?

Bret 



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to