-   Programming (
-   -   ed command problem (

moata_u 03-23-2011 09: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 10: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 02:09 PM


You could probably use:
ed -s << edcommands

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

jschiwal 03-23-2011 05: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 07:18 AM.