The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing variable from bash to perl from bash script arsidh Shell Programming and Scripting 10 06-04-2008 12:25 PM
Converting bash shell to perl freak UNIX for Dummies Questions & Answers 4 05-29-2008 12:35 AM
Comp-3 conversion possible with Shell Scripting or PERL? dfran1972 Shell Programming and Scripting 13 02-23-2008 07:51 PM
bash to perl conversion thumper Shell Programming and Scripting 2 07-14-2006 03:36 PM
Conversion of bash parsing script to perl? cstovall Shell Programming and Scripting 2 10-13-2004 10:33 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-28-2008
freak freak is offline
Registered User
  
 

Join Date: May 2008
Posts: 9
Another bash shell to perl conversion

Hello everyone. I am new to linux and need help again. I need help converting this bash shell to linux:

Code:
for i in `ls -l *.txt`
do
`./cnvidtf.pl $i`
`curl -u login:pswd --disable-espv -T loadfile.seq ftp://11.1.11.1`
`mysql -u login -h 11.1.11.1 -ppswd < lddocs.sql`
done
Thanks! Any help would be greatly appreciated.
  #2 (permalink)  
Old 05-29-2008
ripat ripat is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2006
Location: Belgium
Posts: 438
It looks to me that this is already a bash script although a bit peculiar. Back ticks and the ls command are superfluous. How about this:

Code:
for i in *.txt
do
    ./cnvidtf.pl $i
    curl -u login:pswd --disable-espv -T loadfile.seq ftp://11.1.11.1
    mysql -u login -h 11.1.11.1 -ppswd < lddocs.sql
done
  #3 (permalink)  
Old 05-29-2008
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
he wants to convert the bash script to a perl script
  #4 (permalink)  
Old 05-29-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
It's not really clear that the backticks are superfluous. If each of those commands in backticks prints something which can be interpreted as a command, that command will be executed. (I'd be surprised, but that's what the script means. If it's incorrect, then posting a corrected script would be a good first step; porting erroneous code doesn't make much sense.)

If the script is indeed correct, it would help immensely to know what those commands in backticks print, and what the purpose of this script is. (Also, porting it to Perl seems misdirected to say the least, as it's using some of the most powerful and unique features of the shell.)
  #5 (permalink)  
Old 05-29-2008
freak freak is offline
Registered User
  
 

Join Date: May 2008
Posts: 9
Sorry

I meant converting the bash shell to a perl script.
  #6 (permalink)  
Old 05-29-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Repeat: please verify that the script is correct, and if so, reveal what we can expect the output from the backticks to be like.
  #7 (permalink)  
Old 05-29-2008
jamesapp jamesapp is offline
Registered User
  
 

Join Date: May 2008
Posts: 12
how do i start a new thread?
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0