comparison build-aux/install-reloc @ 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 5fd32d128129
children 9e8fb35d4032
comparison
equal deleted inserted replaced
40199:dd30d6eb93bd 40200:19988ebda9fa
206 fi 206 fi
207 207
208 # Outputs a command and runs it. 208 # Outputs a command and runs it.
209 func_verbose () 209 func_verbose ()
210 { 210 {
211 echo "$@" 211 # Make it easy to copy&paste the printed command into a shell in most cases,
212 # by escaping '\\', '"', and '$'. This is not perfect, just good enough.
213 echo "$@" | sed -e 's/\([\\"$]\)/\\\1/g'
212 "$@" 214 "$@"
213 } 215 }
214 216
215 # Run install_command. 217 # Run install_command.
216 func_verbose $install_prog "$@" || exit $? 218 func_verbose $install_prog "$@" || exit $?