Date: 2009-11-12 23:45:00
look before you leap
I started to investigate yesterday's idea of a shell implementation in Perl, and immediately got mired in the Byzantine shell quoting rules. The most basic thing about the shell turns out to be unnecessarily hard, and besides, it's already been done. Why did I think this was a good idea again?

Somehow I had got it into my head that msysgit on Windows would only run from the msysgit shell. Since I don't actually use Git on Windows, it turns out I was mistaken. If you run any Git command from the regular Windows command prompt, it already works. The appropriate shell is invoked to execute the shell script (git-rebase is one such shell script, instead of being part of the native C implementation).

Nothing to see here, move along...
I feel your pain.

You'd think that there would be a library routine to tokenize a command line into argc/argv. Not globbing, just separating the things out.

There's lots of stuff to parse out options once it's in that state, but getting there is another story, and it's all because of those damn quoting rules.

Windows makes it extra special fun, because MS couldn't use the same path separator that everyone else uses, oh no, they have to use the one that's also used as an escape. I want to find out who made that decision and smack them.
[info]bovineone : Zoidberg
There is a shell written in Perl called Zoidberg, though it doesn't specifically attempt to be exactly "sh" compatible.
Greg Hewgill <>