jneen / balls

Bash on Balls
MIT License
858 stars 44 forks source link

Bashisms #1

Open singpolyma opened 13 years ago

singpolyma commented 13 years ago

Are any bash-specific features actually used in this code? I haven't done a full review yet, but so far all I've seen is the [[ ]] syntax, which can always trivially be replaced by POSIX compatible [ ] syntax

laughinghan commented 13 years ago

While I only contributed review and didn't write any of this, as far as I know it's pretty much just Bourne shell. That stands testing, though.

jneen commented 13 years ago

One thing I rely on heavily is the string manipulation features of bash, for example in the super-hacky trim() function, and in the http-parsing. Is that in vanilla Bourne shell as well?

laughinghan commented 13 years ago

If only there was a test case, so we could just run it through sh.

Also, I just remembered, somewhat relevant, it does depend on a platform specific nc implementation, the one on Darwin (Mac OS X) for example doesn't support -p.

singpolyma commented 13 years ago

A lot of the string manip things are in standard SH, but a few are bash only. I'll have to look at the code more closely (/test on dash) to see if any of the stuff in here would need to be tweaked.

If you look at my shttpd repo you might find some interesting hacks around nc. I may try to write up an shttpd module for this framework just for kicks.

jneen commented 13 years ago

Beautiful, I'd love to be able to hook this up to shttpd :)

jneen commented 13 years ago

Also, some ahem unit tests ahem might be in order.