| | |
execute ksh script in perl
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Sep 2007
Posts: 25
Reputation:
Solved Threads: 0
I am migrating scripts from UNIX server to a Linux. In the perl script it calls rcp to transfer files. It worked ok in UNIX but not in Linux, which has scp, I dont want to do scp now as this is a temporary Linux Box I am using.
I wrote an ftp script to do the work which rcp was doing in UNIX so it would work in Linux. Testing the stand alone ftp works ok, call it within the perl script and it doesn't work
I have tried
system("ftpscript";
exec("./ftpscript");
system("./ftpscript";
ok whats another way to call a shell script within perl. I dont get any error messages. Destination directory does not contain any files.
I wrote an ftp script to do the work which rcp was doing in UNIX so it would work in Linux. Testing the stand alone ftp works ok, call it within the perl script and it doesn't work
I have tried
system("ftpscript";
exec("./ftpscript");
system("./ftpscript";
ok whats another way to call a shell script within perl. I dont get any error messages. Destination directory does not contain any files.
0
#2 Oct 13th, 2009
You can use back-quotes (`) or
You might be running into a problem where one of the commands you execute from your shell script acts differently when it's executed from an interactive shell than it does when it's executed from within another script or by cron.
You won't get the output with either
See http://perldoc.perl.org/functions/system.html and http://perldoc.perl.org/perlop.html#%60STRING%60
--
-- Ghodmode
qx// . You should also redirect the standard error to the standard output in order to capture all of the output.You might be running into a problem where one of the commands you execute from your shell script acts differently when it's executed from an interactive shell than it does when it's executed from within another script or by cron.
You won't get the output with either
system() or exec() , but if you do use system() , you should probably check the exit status of the executed script via system's return value.See http://perldoc.perl.org/functions/system.html and http://perldoc.perl.org/perlop.html#%60STRING%60
--
-- Ghodmode
![]() |
Similar Threads
- How to Store XAMPP in Drive D in Windows XP (PHP)
- I want to copy a file from one host to another host (JSP)
- Execute an sql script with routines in jdbc..? (Java)
- Execute an SQL Script in JDBC (Java)
- why doesnt this work ksh script on solaris 10 (Shell Scripting)
- execute python script from shell/Interactive Window (Python)
- This Should be Easy for You Guys! (Linux Servers and Apache)
- How to execute .exe file from the perl script (Perl)
Other Threads in the Perl Forum
- Previous Thread: Последняя возможность для вас.
- Next Thread: copying a .exe file from one directory to another directory
Views: 896 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Perl





