How to do this.. (SED question) 
Author Message
 How to do this.. (SED question)

I have to create a simple SED script to do the following:
- change on the stdin the word 'aap' for 'mies' and the word
'wim' for the value in $HOME.

Ik came up with the following line I start from a script.
sed -e 's|aap|mies|g' -e 's|wim|'$HOME'|g'

This works fine; I used the | symbol because $HOME uses the
/ symbol ofcourse.

When I start the script, only this line is executed; gets
whatever it gets on the stdin, after which it executes and
replaces..But.. I have to press the enter key twice to get
the results on screen. How can I prevent this from
happening?

All help and tips apreciated

Arnoud



Fri, 09 Jul 2004 21:40:46 GMT  
 How to do this.. (SED question)

Quote:

>I have to create a simple SED script to do the following:
>- change on the stdin the word 'aap' for 'mies' and the word
>'wim' for the value in $HOME.

>Ik came up with the following line I start from a script.
>sed -e 's|aap|mies|g' -e 's|wim|'$HOME'|g'

>This works fine; I used the | symbol because $HOME uses the
>/ symbol ofcourse.

>When I start the script, only this line is executed; gets
>whatever it gets on the stdin, after which it executes and
>replaces..But.. I have to press the enter key twice to get
>the results on screen. How can I prevent this from
>happening?

read x
echo "$x" | sed -e 's|aap|mies|g' -e 's|wim|'$HOME'|g'


Sat, 10 Jul 2004 04:10:46 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie awk (sed??) question, regular expressions

2. Awk/Sed Filehandler question

3. A very simple question on SED or AWK for a GURU, and an enjoyable problem

4. A question about sed

5. a sed question

6. SED question

7. awk or sed: basic? question

8. Sed Question

9. 2 questions from book sed and awk programming

10. Urgent VI/SED question

11. Stupid question...Is sed in gawk??

12. [Fwd: question about sed.]

 

 
Powered by phpBB® Forum Software