From 82519af2d88067e8e8e2fe620bdfefa7e50b658d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 24 Feb 2019 15:18:24 +0100 Subject: [PATCH] relocatable-prog: Improve verbose output. * build-aux/install-reloc (func_verbose): Escape characters that would be interpreted by the shell. --- ChangeLog | 6 ++++++ build-aux/install-reloc | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 176bff1952..1f4205582e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-02-24 Bruno Haible + + relocatable-prog: Improve verbose output. + * build-aux/install-reloc (func_verbose): Escape characters that would + be interpreted by the shell. + 2019-02-24 Bruno Haible stat, lstat: Fix conflict with relocatable-prog-wrapper module. diff --git a/build-aux/install-reloc b/build-aux/install-reloc index e68386e7f2..75c367468e 100755 --- a/build-aux/install-reloc +++ b/build-aux/install-reloc @@ -208,7 +208,9 @@ fi # Outputs a command and runs it. func_verbose () { - echo "$@" + # Make it easy to copy&paste the printed command into a shell in most cases, + # by escaping '\\', '"', and '$'. This is not perfect, just good enough. + echo "$@" | sed -e 's/\([\\"$]\)/\\\1/g' "$@" } -- 2.39.5