Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!redcloud!clyne From: clyne@redcloud.ucar.edu (John Clyne) Newsgroups: comp.unix.questions Subject: parsing commands in a makefile Message-ID: <4782@ncar.ucar.edu> Date: 21 Oct 89 00:43:43 GMT Sender: news@ncar.ucar.edu Reply-To: clyne@ncar.ucar.edu.UUCP (John Clyne) Organization: Scientific Computing Division/NCAR, Boulder CO Lines: 34 Sorry if this has been beat to death before, but here goes anyway. I have a makefile that I want to use a sed command as a rule. I need to do an sed append. The syntax for this with sed is something like: % sed -e "/patten/a\ text to append" < in_file > out_file The newline after the 'a' must be passed to sed. On the shell command line this is easy. You just escape the newline with a '\'. The problem is in a makefile all rules must be contained on a single line. If you try something like the following in a makefile: target: sed -e "/pattern/a\ text to append" < in_file > out_file What sed gets passed is "/pattern/atext to append" Is there any way around this? i.e how can I pass a new line to a command that is part of a make rule? thanks much - jc John Clyne (clyne@ncar.ucar.edu) c/o National Center for Atmospheric Research P.O. Box 3000 Boulder, Colorado 80307 (303) 497-1236 %%% Its a small world. But I wouldn't want to paint it %%% S. Wright %%% %%%