jwerle / mush

Mustache templates for bash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eats backslashes

martin-langhoff opened this issue · comments

Examples using cat to remove the shell parsing implicit in using echo.

$ cat somefile
foo\wbar
$ cat somefile | ./mush.sh
foowbar
$ cat somefile | ./mush.sh > someoutput
$ cat someoutput
foowbar

After some experimentation with replacing echo ${line} in some places with printf %q "${line} and read -r (see http://stackoverflow.com/questions/924388/sh-read-command-eats-slashes-in-input ) I might have a fix.

Ah good catch. I'd happily accept a PR !

On Wed, Jun 1, 2016, 7:58 PM Martin Langhoff notifications@github.com
wrote:

After some experimentation with replacing echo ${line} in some places
with printf %q "${line} and read -r (see
http://stackoverflow.com/questions/924388/sh-read-command-eats-slashes-in-input
) I might have a fix.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/ABZSvewVqJcx9VIPbFOiZCCirTES_T9Fks5qHhylgaJpZM4IsFdf
.