Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bashisms #1

Open
singpolyma opened this issue Jul 19, 2011 · 6 comments
Open

Bashisms #1

singpolyma opened this issue Jul 19, 2011 · 6 comments

Comments

@singpolyma
Copy link

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
Copy link
Collaborator

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
Copy link
Owner

jneen commented Jul 19, 2011

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Owner

jneen commented Jul 21, 2011

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

@jneen
Copy link
Owner

jneen commented Jul 21, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants