# HG changeset patch # User Bruno Haible # Date 1551017904 -3600 # Node ID 19988ebda9fa4c0ba815c84083cd7ea8324a0a2f # Parent dd30d6eb93bd6b9d4a4a34097af330aed4420aea relocatable-prog: Improve verbose output. * build-aux/install-reloc (func_verbose): Escape characters that would be interpreted by the shell. diff -r dd30d6eb93bd -r 19988ebda9fa ChangeLog --- 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 + + 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 -r dd30d6eb93bd -r 19988ebda9fa build-aux/install-reloc --- 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' "$@" }