Hacker News new | ask | show | jobs
by anonymous_fun 3437 days ago
The escaping in Bash can be a pain. I was recently writing an execution wrapper in Bash, and needed to send the results via JSON. Fighting with the quotes was almost enough to make me throw in the towel and move to a language with a builtin JSON parser, but I ran across this technique, of embedding a heredoc to preserve quotes in a variable. https://gist.github.com/kdabir/9c086970e0b1a53c3df491b20fcb0... It 'simplified' things and kept them readable.

Thanks for sharing awklisp. Nice reading for a Sunday morning.

1 comments

I'm glad you enjoyed that, thanks. :)