Thread View: comp.unix.shell
2 messages
2 total messages
Started by fitz
Mon, 07 Jan 1991 01:28
ed script "here" document in a Makefile
Author: fitz
Date: Mon, 07 Jan 1991 01:28
Date: Mon, 07 Jan 1991 01:28
22 lines
1018 bytes
1018 bytes
This shell script with an ed script splits my file into two new files: ed foo <<E_O_F 1,/^ *References$/-1w foo.body /^ *References$/+1,$w foo.ref q E_O_F This makefile does the same thing for me: EDSCRIPT= 1,/^ *References$$/-1w $(DOC).body@\ /^ *References$$/+1,$$w $(DOC).ref@\ q ed: $(DOC) echo '$(EDSCRIPT)' | tr @ '\012' | ed $(DOC) My question: Can a makefile rule contain a "here" document like my first example? Please post tested solutions that use the standard "ed", "sh", and "make". Thanks! Brian Fitzgerald
Re: ed script "here" document in a Makefile
Author: Brian Fitzgerald
Date: Tue, 08 Jan 1991 19:34
Date: Tue, 08 Jan 1991 19:34
18 lines
1088 bytes
1088 bytes
In article <}7W^DZ_@rpi.edu> I meant to ask how to "embed" a "here" document in a Makefile like this: ed: $(DOC) ed $(DOC) <<E_O_F 1,/^ *References$/-1w $(DOC).body /^ *References$/+1,$w $(DOC).ref q E_O_F With or without trailing backslashes, the second line gets run as a shell command and I get "sh: *References-1w:" not found and so on. A certain net-guru (who uses four rows of the keyboard to spell his name!) has given me strong reason to suspect that there is no portable way to do this but that SysV "augmented" make may. It's still up for grabs if anyone is interested. Brian Fitzgerald
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads