473,395 Members | 1,484 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Calling a unix shell script from a perl script

I am calling a unix shell script from a perl script by using the following system command:
system("./readfile_new.sh");

but it seems the unix script readfile_new.sh is not being called.
Can someone let me know how to call this script in the perl file/
Oct 26 '06 #1
4 11180
miller
1,089 Expert 1GB
Is the script in the currently active directory? The above code should work, at least this works for me.

system("./myOtherPerlScript.pl")

http://perldoc.perl.org/functions/system.html
Oct 26 '06 #2
divzz
2
I am calling a unix shell script from a perl script by using the following system command:
system("./readfile_new.sh");

but it seems the unix script readfile_new.sh is not being called.
Can someone let me know how to call this script in the perl file/

Hi,
you can call the shell script through a perl script using the following command below....

system("sh","readfile_new.sh");

If your shell file is in current directory,then this should work. (FYI: I use korn shell). If your sh script is in some other dir then specify the path.
Hope this works for you.
Feb 1 '08 #3
divzz
2
I am calling a unix shell script from a perl script by using the following system command:
system("./readfile_new.sh");

but it seems the unix script readfile_new.sh is not being called.
Can someone let me know how to call this script in the perl file/
oops.. u had posted in 2006!!! I noticed it after posting my reply !!
Feb 1 '08 #4
you can use either system function call or keep the unix command you want to execute between backticks.
Feb 1 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike Bobbitt | last post by:
I've recently decided to switch from compiled Apache/PHP to RPM's of both and I'm having a problem I can't seem to solve. I have a Perl script called php_include.cgi that parses a PHP file for...
2
by: Dmitry | last post by:
Hi folks! I need to find a way to switch to a different Unix user from within the Perl script that is currently ran unattended. Script must switch user in order to execute proper profile for...
3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
2
by: Mohsin | last post by:
Hi all, I have a perl program which makes a user exit to the O/S (unix, solaris) to issue a O/S command. I know that the shell it invokes is NOT a korn shell, because I captured the shell info...
1
by: Al Belden | last post by:
Hi all, I've been working on a problem that I thought might be of interest: I'm trying to replace some korn shell scripts that search source code files with perl scripts to gain certain features...
4
by: Ignoramus6539 | last post by:
There were some strange requests to my server asking for config.php file (which I do not have in the requested location). I did some investigation. Seems to be a virus written in perl,...
2
by: sunilsn | last post by:
Hi, I am newbie to perl, I hope you guys will help me resolve the challenge I am facing. I have a unix shell script on one UNIX machine say A, and a batch file on windows machine say B. Now I want...
0
by: nghivo | last post by:
I have a Struts application developed following the MVC method (forms, actions, beans, etc).. I have a JSP page with 2 buttons A and B. When B is clicked, a Struts action will be executed. But...
2
by: pisupati | last post by:
Hi, I need to a solution through perlscript. I have a unix process (ksh) running in a unix box. In the middle (of this process) there is a need to call a windows program and execute some steps...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.