From: Robert Schwebel <r.schwebel@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] ptxd_install_replace_figlet: Use sed instead of awk to quote backslashes
Date: Fri, 5 Oct 2018 17:50:09 +0200 [thread overview]
Message-ID: <20181005155009.wezdsvt4euuwoill@pengutronix.de> (raw)
In-Reply-To: <20180919084336.4357-1-u.kleine-koenig@pengutronix.de>
Hi Uwe,
On Wed, Sep 19, 2018 at 10:43:36AM +0200, Uwe Kleine-König wrote:
> TL;DR: awk and backslashes in the replacement argument of gsub is ugly.
>
> With GNU Awk 4.0.2 we have:
>
> $ echo '\' | awk '{ gsub("\\\\", "\\\\\\\\\\\\\\\\"); print }'
> \\\\\\\\
>
> and with GNU Awk 4.1.4 (and newer) we have:
>
> $ echo '\' | awk '{ gsub("\\\\", "\\\\\\\\\\\\\\\\"); print }'
> \\\\
>
> This results in too much backslashes in /etc/issues for users of the
> former version.
>
> For the glory details I recommend reading through
>
> https://www.gnu.org/software/gawk/manual/html_node/Gory-Details.html
> https://bugs.debian.org/909147
>
> As it's awkward to come up with an expression that does the same on both
> versions (e.g. using --posix) use sed instead.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This has now landed in ptxdist-2018.10.0, and it is broken.
Here is what DistroKit outputs:
____ _ _
| _ \ ___ _ __ __ _ _ _| |_ _ __ ___ _ __ (_)_ __
| |_) / _ \ '_ / _` | | | | __| '__/ _ | '_ | / /
| __/ __/ | | | (_| | |_| | |_| | | (_) | | | | |> <
|_| \___|_| |_|__, |__,_|__|_| ___/|_| |_|_/_/_DistroKit |___/
____ _ _ _ ___ _
| _ \(_)___| |_ _ __ ___ | |/ (_) |_
| | | | / __| __| '__/ _ \| ' /| | __|
| |_| | \__ |_| | | (_) | . | | |_
|____/|_|___/\__|_| ___/|_|__|__|
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
next prev parent reply other threads:[~2018-10-05 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-19 8:43 Uwe Kleine-König
2018-10-05 15:50 ` Robert Schwebel [this message]
2018-10-05 20:52 ` [ptxdist] [PATCH] ptxd_install_replace_figlet: replace all backslashes, not only the first Uwe Kleine-König
2018-10-06 10:30 ` Robert Schwebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181005155009.wezdsvt4euuwoill@pengutronix.de \
--to=r.schwebel@pengutronix.de \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox