PERL SSH call error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting PERL SSH call error
# 1  
Old 09-16-2009
PERL SSH call error

I have a Perl Script

Code:
#!/usr/local/bin/perl

$server_name = "info-xyz-05";

my $value = `/usr/bin/ssh -f $server_name /users/salesadm/MGFINFA/bridgerftpup.sh`;

The above calls a shell script on another server called bridgerftpup.sh. This script has several commands and needs to call scripts which exist in the same folder. However, when I execute the Perl Script I get the following errors:

Code:
/users/salesadm/MGFINFA/bridgerftpup.sh[9]: =/users/salesadm/MGFINFA: cannot execute
rm: cannot remove `*.gpg': No such file or directory
/users/salesadm/MGFINFA/bridgerftpup.sh[16]: ./expect_bridgerdel.sh: cannot execute
gpg: can't open BridgerRequestMGP-*.csv: No such file or directory
gpg: BridgerRequestMGP-*.csv: encryption failed: file open error
/users/salesadm/MGFINFA/bridgerftpup.sh: line 22: ./expect_bridgerup.sh: not found

The script bridgerftpup.sh executes fine when executed from the destination server.

For reference the script bridgerftpup.sh is as follows:

Code:
#!/usr/bin/ksh


#Delete files from target File Directory
rm *.gpg

#Delete files from FTP Output Location
./expect_bridgerdel.sh

#Encrypt Current Output File
gpg -e xyx xyx xyxyx " BridgerRequestMGP-*.csv

#Upload encrypted file
./expect_bridgerup.sh > bridgerftpup.log

Any suggestions how to remove the error messages?

---------- Post updated at 06:13 PM ---------- Previous update was at 06:12 PM ----------

I tried putting full paths in the script bridgerftpup.sh but it still causes errors!
# 2  
Old 09-16-2009
Quote:
Originally Posted by alfredo123
I have a Perl Script

Code:
#!/usr/local/bin/perl

$server_name = "info-xyz-05";

my $value = `/usr/bin/ssh -f $server_name /users/salesadm/MGFINFA/bridgerftpup.sh`;

...
...
Does the following command:

Code:
/usr/bin/ssh -f info-xyz-05 /users/salesadm/MGFINFA/bridgerftpup.sh

run successfully from the command prompt of the server where your Perl script exists ?

tyler_durden
# 3  
Old 09-16-2009
Quote:
Originally Posted by alfredo123
I tried putting full paths in the script bridgerftpup.sh but it still causes errors!
What error's ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Perl error: Can't call method "value" on an undefined value

Hi, I am running a perl script to automate a process and I keep running into a error can't find the "value" Can't call method "value" on an undefined value at process_file.pl line 44. file is CVS cell is ifdfdxrfmp.ksh Here is the script I have also attached it as well: ... (2 Replies)
Discussion started by: vpundit
2 Replies

2. Shell Programming and Scripting

Call .profile in perl script

Hello Gurus Can anyone please let me know how to call .profle file in perl script When I am calling the .profile file its giving error Shall I create unix script which has .profile command and call perl script internally (2 Replies)
Discussion started by: Pratik4891
2 Replies

3. Shell Programming and Scripting

how to call a bash script using perl

Hi I m new to perl. I m trying to write a perl script that calls a bash script; does anyone have a script already that they can provide or help me out? Thanks a lot. (2 Replies)
Discussion started by: adnan786
2 Replies

4. Shell Programming and Scripting

[Perl] Capture system call error message.

Hi, I googled a bit, but could not find the answer to my problem. But I am sure it is a common issue. I have this code: #!/bin/perl -w #-d use strict; sub remsh_test() { my $host = $_; printf "\n----\n\n"; printf "remsh to $host with system call\n"; my $result = system... (3 Replies)
Discussion started by: ejdv
3 Replies

5. Infrastructure Monitoring

diffrence between method call and function call in perl

Hello, I have a problem with package and name space. require "/Mehran/DSGateEngineLib/general.pl"; use strict; sub System_Status_Main_Service_Status_Intrusion_Prevention { my %idpstatus; my @result; &General_ReadHash("/var/dsg/idp/settings",\%idpstatus); #print... (4 Replies)
Discussion started by: Zaxon
4 Replies

6. Shell Programming and Scripting

Please Help: How to Call SSH Trust from Cron job.

Hi All, I am tring to excute a SSH trust command from a script which is invoked by crontab. Details: Crontab file contains the following line: 15 00 * * * /users/dummy_user/dummy_script1.sh dummy_script1.sh contains the following line: SSH -1 server_2... (4 Replies)
Discussion started by: suman82
4 Replies

7. Shell Programming and Scripting

Perl call C programs

Hi, I am a beginner in Perl programming. Now i need to call a C program from a perl program ...Can any one please help me and give any details how i can do this. Thanks and Regards (3 Replies)
Discussion started by: gjithin
3 Replies

8. Shell Programming and Scripting

perl function call tracking

Assuming the following code sub foo { dosomething {...} else { foo } is the number of times foo has been called kept track of internally and how could I access that count? (1 Reply)
Discussion started by: thumper
1 Replies

9. Shell Programming and Scripting

how to call a perl script from tcsh?

Hi I am not sure how to call a perl script from a tcsh shell. do i need to set any environment variables? your help is appreciated Thanks (1 Reply)
Discussion started by: megastar
1 Replies

10. UNIX for Dummies Questions & Answers

how can call perl script as command?

Hello say i have written some perl scripts , now i like to call them in my unix shell as unix command like "more" , "ls" , "grep" so that my say perl script called "foo.pl" will be called from every where as "foo" or "foo arg1 arg2"? Thanks (1 Reply)
Discussion started by: umen
1 Replies
Login or Register to Ask a Question