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
bash awk codes to perl phamp008 Shell Programming and Scripting 1 03-15-2008 05:11 AM
bash to perl conversion thumper Shell Programming and Scripting 2 07-14-2006 03:36 PM
Perl script - changing passwords thehoghunter Shell Programming and Scripting 3 05-03-2002 10:11 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-30-2008
freak freak is offline
Registered User
  
 

Join Date: May 2008
Posts: 9
Need help with changing bash to perl

Hi guys,
I am converting a bash script to perl. I need lots of help and pointers on how to make the script work. Any help would be greatly appreciated. Here is what I have:
#!/usr/bin/perl
#Decrypt Files
$dir = "/usr/bin/gpg;
opendir(PGP_DIR, $dir) || die "can't opendir $dir: $!";
@pgp_files = grep { /pgp$/ && -f "$dir/$_" } readdir(PGP_DIR);
closedir(PGP_DIR);

for my $pgp_file (@pgp_files) {
my @output = `usr/bin/gpg --passphrase-fd 0 $pgp_file < .sunspot`;


#Move Decrypted files to pgps/End of Month Folder

move("pgp_file", "pgps/20080531") || die "move failed: $!";

#Change directory to txt
chdir "$idtdata/txts" || die "Can't change to $idtdata/txts: $!\n";

#Move text files
mv../*.txt .;

#Remove Database files
rmdir loadfile.seq;

#Update text files

$some_dir = " "
opendir(TXT_DIR, $dir) || die "can't opendir $some_dir: $!";
@txt_files = grep { /txt$/ && -f "$some_dir/$_" } readdir(TXT_DIR);
closedir(TXT_DIR);

for my $txt_file (@txt_files){
my @output = `./cvnidtf.pl $txt_file`
`curl -u mydriveasswd --disable-epsv -T loadfile.seq ftp://11.1.11.1`
`mysql -u tdrive -h 11.1.11.1 -ppasswd < ldinsdocs.sql`;


#Move Updated text files to hold in Beginning of the month folder
move("txt_files", "hold/20080501") || die "move failed: $!";
 

Bookmarks

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 06:36 AM.


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