fix!: Use %b in generated printf statements (vs %s)
closes #25
Looks like I was supposed to be using %b all along:
- https://www.unix.com/man-page/posix/1posix/printf/
... An additional conversion specifier character, b , shall be supported as follows. The argument shall be taken to be a string that may contain backslash-escape sequences
It appears that many shells treat %s and %b similarly, which is likely why I didn't discover the issue earlier.
As a posix printf standard, this should just be an improvement, correcting behavior for shells like DASH.
cc: @0xEAB lemme know if you have time to give this a test drive.
cat bug.txt
RUN apt-get update && \
apt-get -y install --no-install-recommends
./bash-tpl_patched bug.txt | /bin/dash
RUN apt-get update && \
$ apt-get -y install --no-install-recommends
Closing this MR as its not a working solution to the problem ...
@0xEAB I've re-opened this MR after having a chance to do some research - I've implemented a printf %b compatible escape function which I hope doesn't break other users once its released :)
I'd appreciate if you had a had a chance to give it another try!
Works for me.