From: Junio C Hamano Date: Sat, 21 Jan 2006 20:12:28 GMT Subject: Re: problem installing latest cogito Message-ID: <7vmzhpl4r7.fsf@assigned-by-dhcp.cox.net> In-Reply-To: sean writes: > On Sat, 21 Jan 2006 20:48:26 +0100 > Petr Baudis wrote: > >> > sed -e >> > 's/\${COGITO_LIB}/\${COGITO_LIB:-\/home\/david\/lib\/cogito\/}/g; \ >> > >> > s/\${COGITO_SHARE}/\${COGITO_SHARE:-\/home\/david\/share\/cogito\/}/g' >> > \ >> > $file > $file.new; \ >> > cat $file.new > $file; rm $file.new; \ >> > done >> > sed: -e expression #1, char 145: unterminated address regex > > The problem seems to go away if you remove the quoted end-of-line: That is not "the quoted end-of-line". Backslashes do not have any special meaning inside a single quote pair for bourne shell quoting. The script is passing the backslash to sed. IIRC, make seems to do different things for the backslash at the end of line depending on vintage, so if this scriptlet appears in a Makefile you may have another version dependency. I usually cop out of this problem by having a separate shell script and run it from the Makefile, instead of spelling out the sed commandline in the Makefile. I got a complaint or two that some version of sed does not like ';' to concatenate more than one commands, and have been trying to train myself to do either multiple -e options or multi-line scripts. E.g when I am tempted to say: sed -e 's/foo/bar/;s/baz/boa/' froboz Instead, I say either sed -e 's/foo/bar/' -e 's/baz/boa/' froboz or sed -e ' s/foo/bar s/baz/boa/ ' froboz I do not know how much of the above applies to your immediate problem, but I hope some of it helps.