469,282 Members | 1,715 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

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 10964
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

Post your reply

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

Similar topics

reply views Thread by Mike Bobbitt | last post: by
2 posts views Thread by Dmitry | last post: by
2 posts views Thread by Mohsin | last post: by
1 post views Thread by Al Belden | last post: by
4 posts views Thread by Ignoramus6539 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.