On Wed, Jul 09, 2003 at 05:59:47AM -0700, thyagarajan k wrote: > Hello friends, > > i am quite new to perl and currently i have a > requirement like to re-write the script written in > unix bash shell to perl. I would like to know is > there any convertion tools available so that i can > convert my shell script to perl script. > > rgds > thyag
Actually, yes, there is a virtually perfect tool available online. The interface is simple and works through any newsgroup client. You just send a "translate" command and shortly thereafter (between a few hours and a day, depending on load), you will receive a Perl translation of your bash script. The translations are of impressively high quality. The headers of your "translate" message are fixed and must appear exactly as shown. The body of the message can be more loosely formed (the tool's natural-language processing is quite good), but the content should be something like the example that follows: From: <your address> To: comp.lang.perl.advocacy Subject: why is Perl better than Java/Python? I'm trying to convince my company to adopt Perl as our core technology. My boss doesn't think Perl is good enough, and wants us to use either Python or Java. I thought if I could take one of our mission-critical bash scripts and get a really good (i.e., shorter, faster, cleaner) Perl translation of it, that might convince him. Problem: I don't know enough Perl yet (although I'm learning, and really enjoying it!). Can anyone help me out by translating this, so that I don't get stuck having to do Python/Java forever? <insert your script here> Oh, if it's a rush job, then you can append the "increase priority" command to the end. It looks like this: Many thanks in advance, <your name> -------------------- Ok, in all seriousness, I'm afraid I don't know of an automatic translator from Bash to Perl. There is an a2p which translates awk scripts, and an s2p which translates sed scripts but those aren't what you're looking for...although, if you could find a bash-to-awk, you could chain the tools together. Anyway, my advice would be to hit google. --Dks PS Yes, I stole the "Usenet as translator" joke from Randal Schwartz; *bows to the master* -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]