Sam's Blog entries for category 'note-to-future-me' Subscribe to feed for category 'note-to-future-me'

Note to future me: Are you trying to remember how to shell-quote/escape the contents of a variable to avoid going utterly insane from the nested double-quotes and backslashing?

printf -v escaped_var "%q" "$var" is the command that you can never remember, and never find the documentation for until you've wasted a morning of your life.

Don't forget it next time. Or at least, remember that you wrote this note, kthxbai.

Browse Sam's Blog Subscribe to Sam's Blog

By year: 2010, 2011, 2012, 2013.

Or by: category or series.

© 2009-2013 Sam Graham, unless otherwise noted. All rights reserved.