a sed question 
Author Message
 a sed question

Usually awk users rely heavily on sed, so I will dare post this question
here.

Is there a way to test the validity of a sed script without actually running
it?

This is my context:

In the beginning there was a 'find' command that fed a pattern (*.html)
to -exec and a sed script.  Overkilling the problem I encapsulated the lot
in a shell script that takes a sed script as parameter, etc.  However,
before executing the script i would like to test the syntactical validity of
the sed script.

any clues?



Sun, 22 Dec 2002 03:00:00 GMT  
 a sed question

Quote:

>Usually awk users rely heavily on sed, so I will dare
>post this question here.

Questionable asertion, certainly not true for me. FWIW, sed
questions would be more on-topic in alt.comp.editors.batch,
comp.editors and comp.unix.shell.

Quote:
>Is there a way to test the validity of a sed script
>without actually running it?

No, but you can run it with empty standard input, just like
you could do with an awk script using awk. The following
works in the korn shell.

sed -f sed_script_file /dev/nul 2> /dev/nul || echo FAILED!

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful



Sun, 22 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to do this.. (SED question)

2. SED question

3. Sed Question

4. Urgent VI/SED question

5. This might be a sed question

6. sed question

7. A sed question

8. awk vs. sed question

9. A sed question

10. sed question: unreliable "/^$/d" ?

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

12. Awk/Sed Filehandler question

 

 
Powered by phpBB® Forum Software