changeset 40200:19988ebda9fa

relocatable-prog: Improve verbose output. * build-aux/install-reloc (func_verbose): Escape characters that would be interpreted by the shell.
author Bruno Haible <bruno@clisp.org>
date Sun, 24 Feb 2019 15:18:24 +0100
parents dd30d6eb93bd
children 24f6637d57d0
files ChangeLog build-aux/install-reloc
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Feb 24 11:59:48 2019 +0100
+++ b/ChangeLog	Sun Feb 24 15:18:24 2019 +0100
@@ -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.
--- a/build-aux/install-reloc	Sun Feb 24 11:59:48 2019 +0100
+++ b/build-aux/install-reloc	Sun Feb 24 15:18:24 2019 +0100
@@ -208,7 +208,9 @@
 # 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'
   "$@"
 }