Another bash shell to perl conversion


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Another bash shell to perl conversion
# 1  
Old 05-28-2008
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  
Old 05-29-2008
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  
Old 05-29-2008
he wants to convert the bash script to a perl script
# 4  
Old 05-29-2008
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  
Old 05-29-2008
Sorry

I meant converting the bash shell to a perl script.
# 6  
Old 05-29-2008
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  
Old 05-29-2008
how do i start a new thread?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Conversion of Perl Script to Shell Script..

Hi Guys I am having a perl script that fetches exclude list from a unix client and I trying it to convert it to shell script but I am having issues please help me... #!/usr/bin/perl use strict; use warnings; use Getopt::Std; # To turn on debuging (i.e. more information) specify... (29 Replies)
Discussion started by: Pawan Ramnani
29 Replies

2. Shell Programming and Scripting

Bash to sh conversion

declare -i DEFINT=1 declare -i DEFDELAY=1 declare -i timeout=DEFTOUT declare -i interval=DEFINT declare -i delay=DEFDELAY if (($# == 0 || interval <= 0)); then printUsage exit 1 fi ( ((t = timeout)) while ((t > 0)); do sleep $interval kill -0 $$ ||... (5 Replies)
Discussion started by: SkySmart
5 Replies

3. Shell Programming and Scripting

Help required for Oracle database shutdown script conversion from shell to perl

Please tell me how to convert below program from shell script to perl. Same commands need to use in shutdown, just need program help for startup. export ORACLE_BASE=/home/oracle1 lsnrctl start lndb1 sqlplus '/ as sysdba' startup; (2 Replies)
Discussion started by: learnbash
2 Replies

4. Shell Programming and Scripting

shell or perl script needed for ldif file to text file conversion

This is the ldf file dn: sdcsmsisdn=1000000049,sdcsDatabase=subscriberCache,dc=example,dc=com objectClass: sdcsSubscriber objectClass: top postalCode: 29600 sdcsServiceLevel: 10 sdcsCustomerType: 14 givenName: Adelia sdcsBlackListAll: FALSE sdcsOwnerType: T-Mobile sn: Actionteam... (1 Reply)
Discussion started by: LinuxFriend
1 Replies

5. Shell Programming and Scripting

Conversion from Perl to Shell scripting

Hai ! I am doing a research on Bioinformatics and a part of the code in perl have to be converted to shell scripting. I am new to shell programming. Pls. kindly help me to convert this code to shell script though it is somewhat lengthy. PLS KINDLY HELP ME. THANKS IN ADVANCE. my @FreeEnergy =... (1 Reply)
Discussion started by: kswapnadevi
1 Replies

6. Shell Programming and Scripting

Perl cmds doesn't work in Bash shell . Plz help

Hi everyone, I have a Linux OS in my PC (older version 9). Its default shell is bash. Whenever I try to run some Perl program it throws error ! eg, if I run this simple PERL program , #!/usr/bin/perl printf "\lHello \n"; $var=3 ; printf $var; @list=(1,2,3); printf "@list";... (6 Replies)
Discussion started by: adc22
6 Replies

7. Shell Programming and Scripting

Help! Need to convert bash shell to perl

Hello All. I am very new to Linux and I am currently interning. I have been working on a project for 2 weeks now and I have had no success. I have to convert bash shell into perl to decrypt and store files. Here is the code in Linux and Bash. Any help would be greatly appreciated. $... (0 Replies)
Discussion started by: freak
0 Replies

8. UNIX for Dummies Questions & Answers

Converting bash shell to perl

Does anyone know how to convert this bash shell script to perl? for i in `ls -l *pgp` do `usr/bin/gpg --passphrase-fd 0 $i < .sunspot` done Thanks! Any help would be appreciated. I'm new to Linux and perl. (4 Replies)
Discussion started by: freak
4 Replies

9. Shell Programming and Scripting

Comp-3 conversion possible with Shell Scripting or PERL?

I guess the subject asks it all, but I am wondering (before I go and code a COBOL module) if conversion of regular ASCII data to COMP-3 is possible on a UNIX environment (AIX 5.1)? Any help would be appreciated! Thanks, Dave (13 Replies)
Discussion started by: dfran1972
13 Replies

10. Shell Programming and Scripting

Conversion of bash parsing script to perl?

I need help with a perl parsing script. I have some error logs on a windows machine that I need to parse from a text file, but I know nothing about perl. I usually run this bash script on my linux box and it does just what I need. How would I do the same thing with perl and port it to my windows... (2 Replies)
Discussion started by: cstovall
2 Replies
Login or Register to Ask a Question