>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



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

Reply via email to