in reply to Re: RFC: UNIX shell to Perl converter
in thread RFC: UNIX shell to Perl converter

Sounds like a fun project with lots of pain. :-)

How about about patching 'bash' to show what is done? There might even be some debugging stuff in there already, which could be used?

Then you could get a log of:

Line X: run program "a" and store output into "b". Line X+1: Do something if $? == c
It should make it easier to generate Perl code and you could get the return codes, etc.

Hmm... could generate Perl programs that just did "system" calls and then rewrite them by parts.

Replies are listed 'Best First'.
Re^3: RFC: UNIX shell to Perl converter
by cdarke (Prior) on Oct 11, 2006 at 07:58 UTC
    Yep, I looked at that. I also considered 'lifting' the parser from Bash rather than writing my own, seemed daft to write my own parser when there was already a perfectly good one there. Unfortunately I found that it was not so easy to extract it as a separate entity, it is integrated into the whole product. Someone like Chet Ramey could probably do it, not me.
    As for the pain, this is working out to be almost as good as whipping myself with nettles - Ahhhhh. (No nettles were harmed in the writing of this post).