Sam's Blog entries for 15 June 2012
Shell-quoting future me, printf -v "%q" is what you're looking for
Date: Friday, 15 June 2012, 12:59.
Categories: bash, shell-scripting, 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.
Bash-itunes plugin tutorial
Date: Friday, 15 June 2012, 11:03.
Categories: bash-itunes, itunes, cli, bash, shell-scripting, apple-script, tutorial.
In v1.2.0 of bash-itunes, my project to control iTunes from the command-line, I've added plugin support for sub-commands.
This allows you, or anyone else, to add new commands to the basic script without needing to alter the script itself.
Read below the cut for details and a walkthrough of creating a new plugin.
