-   Programming (
-   -   ed command problem (

moata_u 03-23-2011 10:47 AM

ed command problem
i have write the following script :

ed -s << EOF

and that's work perfectly when i run it in terminal ...
i saved that script in a file, when i try run that file i always got the following error : unexpected end of file ....?? it seems i need to add quot , slash ...`` , '' not sure i have tried nothing work !!

any idea ??

jschiwal 03-23-2011 11:16 AM

You need a q command so that ed quits. It is expecting further input, which could come from stdin in this case.

You could probably use:
ed -s < edcommands

Instead of a HERE document, if this is the entire script.

moata_u 03-23-2011 03:09 PM


You could probably use:
ed -s << edcommands

i already tried that , but does not work as well....

jschiwal 03-23-2011 06:41 PM

I made a mistake. Use "ed -s <edcommands"
First add the 'q' command to the end of ed.commands so that ed quits.

I'll edited my previous message.

All times are GMT -5. The time now is 05:06 PM.