system("ed <stuff>") 
Author Message
 system("ed <stuff>")

This is really an ed question, but I am using a perl script to automate
my running it...  I've tried posting over on comp.unix.questions, but no
response yet :(
And since this group is MUCH higher volume... ;)

Anyway, I've got this ed script I created using diff -e and I need
to run this ed script on a dozen other files.  Since the script is
so large as to be unpractical to rewrite for sed by hand, and I am not
aware of any way to get sed scripts out of diff or of any ed2sed
utilties or even any ed2perl utilities, I am stuck dealing with the ed
script itself.

So, I wrote this little perl program:
foreach $file (<*.e>) {
  system ("ed -s $file <diff.ed >$file.out");


But the output files are empty.
I'm not familiar with ed, but I have been reading the man page to get
a grip on the problem.  diff -e doesn't put any r or w commands or the
like in it, but I am not sure of how they would work in a script like
this, if they were even necessary (does the redirect into file.out do
what I think it does? ;)

Mon, 28 Aug 2000 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. system("pwd"); <- yuck

2. One question about useage "<>"

3. My <!--#exec cgi="\scripts\"-->command will not work

4. About <SCRIPT language="PerlScript">

5. Text() ignored bind("<Tab>")

6. perl -pe "s/<er>/<er>\n"/g": memory efficient version?

7. guestbook in "Learning Perl", 2nd Ed.

8. print <<"EOF";

9. print <<"ending_print_tag";

10. <<ENFofFTP "here-documnet" question

11. <<<<<< HELP >>>>>>>>


Powered by phpBB® Forum Software