Open singpolyma opened 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.
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?
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
.
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.
Beautiful, I'd love to be able to hook this up to shttpd :)
Also, some ahem unit tests ahem might be in order.
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