Just learned the hard way that "echo" inside a shell may or may-not interpret backslashes as special. Porting software always has surprises.
@gustedt Easy fix: echo () { printf %s\\n "$*" ; }
from http://www.etalabs.net/sh_tricks.html
-
-
@RichFelker actually, I wanted it to interpret backslashes, so I did if [ -z `echo -n -e` ] ; then alias echo="echo -e " fi -
@gustedt echo -e is not portable either, and echo -n is not even a conforming extension. -
@RichFelker yes, the test probably needs refinement, but the idea simply is to give it an "-e" if it accepts it as an argument. oh well. -
@gustedt Adapted version of my fix to give -e behavior, should be portable: echo () { printf %b\\n "$*" ; } -
@RichFelker unfortunately not, the shells don't agree on the interpretation of backslashed sequences ... -
@RichFelker with the %b format specifier
End of conversation
New conversation -
-
-
@RichFelker@gustedt better fix, rewrite the whole shell in python. Portable and predictable exec. -
@tehile@RichFelker hm, besides that python would not be my native choice, I think I'd still hesitate to implement python for busybox :) -
@gustedt@RichFelker what stops you from including python with whatever you're distributing your program with? ls -lh `which python2.7`=3.2M -
-
@RichFelker@gustedt you can definitely package the whole thing in a portable way assuming nothing. Shell scripts assume so much more...
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.