The verbose output of the 'install-reloc' script is not copy&paste friendly:
After copy&pasting a logged command, one needs to escape double-quotes, before
running the command from a shell prompt.

Better do this escaping in the script already.

Yes, this will only be an improvement for users who use a Bourne-compatible
shell. But Real Hackers(TM) don't use csh anyway :)


2019-02-24  Bruno Haible  <br...@clisp.org>

        relocatable-prog: Improve verbose output.
        * build-aux/install-reloc (func_verbose): Escape characters that would
        be interpreted by the shell.

diff --git a/build-aux/install-reloc b/build-aux/install-reloc
index e68386e..75c3674 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'
   "$@"
 }
 


Reply via email to