6

Escape text for further passing to zenity

view full story
linux-howto

http://unix.stackexchange.com – I am going to show an error window using zenity: /usr/bin/zenity --error --text="my error message" The error text to pass is obtained as output from another application. This output may contain quotes, backslashes and other special symbols which could prevent zenity to start correctly. /usr/bin/zenity --error --text=$(/usr/bin/some-application) ### e.g. output of /usr/bin/some/application is: failed to "' \perform ### so here will be an error What is the easiest way to normalize such output before passing to zenity? /bin/tr I suppose? But I'd like to show the original message not modifie (HowTos)