Re: [PATCH v4 1/4] Makefile: generate Perl header from template file
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 3, 2017, 05:26 UTC
- Message-ID
- <xmqqr2scjsb4.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <3c897f4c-0cb5-ca44-f144-598a623c1dc3@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 5 quoted lines
>> + sed -e 's=@@PATHSEP@@=$(pathsep)=g' \ > > This doesn't work, unfortunately. When $(pathsep) is ';', we get an > incomplete sed expression because ';' is also a command separator in > the sed language.
It is correct that ';' can be and does get used in place of LF when writing a script on a single line, but even then, as part of a string argument to 's' command (and also others), there is no need to quote ';' or otherwise treat it any specially, as the commands know what their syntax is (e.g. 's=string=replacement=' after seeing the first '=' knows that it needs to find one unquoted '=' to find the end of the first argument, and another to find the end of the replacement string, and ';' seen during that scanning would not have any special meaning).
If your sed is so broken and does not satisfy the above expectation, t6023 would not work for you, I would gess.
t/t6023-merge-file.sh:sed -e "s/deerit.\$/deerit;/" -e "s/me;\$/me./" < new5.txt > new6.txt t/t6023-merge-file.sh:sed -e "s/deerit.\$/deerit,/" -e "s/me;\$/me,/" < new5.txt > new7.txt t/t6023-merge-file.sh:sed -e 's/deerit./&%%%%/' -e "s/locavit,/locavit;/"< new6.txt | tr '%' '\012' > new8.txt