]> Savannah Git Hosting - gnulib.git/commitdiff
relocatable-prog: Improve verbose output.
authorBruno Haible <bruno@clisp.org>
Sun, 24 Feb 2019 14:18:24 +0000 (15:18 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 24 Feb 2019 14:18:24 +0000 (15:18 +0100)
* build-aux/install-reloc (func_verbose): Escape characters that would
be interpreted by the shell.

ChangeLog
build-aux/install-reloc

index 176bff19529e376307da7ca0e9daf5bb809fd8db..1f4205582e08d23804c89467d7f453fdeffb52dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-24  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        stat, lstat: Fix conflict with relocatable-prog-wrapper module.
index e68386e7f2aa212e948a742c83cbc254fa17e8f8..75c367468e6262d772227880de40eb41a99a9c4e 100755 (executable)
@@ -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'
   "$@"
 }