473,387 Members | 1,528 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,387 software developers and data experts.

how to execute shell file in perl?

i have shell file which will execute set commands to activate the mesh interface in my CRB board.
in my perl file i tried to execute using system(location of file);
but am not getting correct output but it is returning true...

my code

$mesh_base="/mnt/jffs2/conf/mesh_start";
system($mesh_base);
Feb 28 '14 #1
2 1294
RonB
589 Expert Mod 512MB
You don't have any error checking/handling on that system call, so how do you know it's returning true?

What output are you getting and how does that differ from what you expect?
Feb 28 '14 #2
miller
1,089 Expert 1GB
As RonB pointed out, you aren't checking to see if system succeeded. According to perldoc system, a true return value would actually be an indication of failure. If you don't want to worry about explicitly checking for success, use the autodie pragma.

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use warnings;
  3. use autodie qw(:all);
  4.  
  5. my $mesh_base = '/mnt/jffs2/conf/mesh_start"'
  6. system($mesh_base);
  7.  
- Miller
Feb 28 '14 #3

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

Similar topics

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...
3
by: Tomasz Ludwiniak | last post by:
Hi, I've little problem... I try to execute asp file ( which return XML file ) and use the result it in my asp script : set xml = Server.CreateObject("MSXML2.DOMDocument") xml.async=false...
2
by: Big Santini | last post by:
Question: how to 'execute' different file types? in example when user choose ..doc file, the deafult application for .doc should run. jaro
1
by: Watermark | last post by:
i need help i want to call shell from php i try exec and system but it isn't working please give me help to come out of this problem
2
by: prakashpb | last post by:
Hello All, I am new to perl. I have to write some code in perl on windows. I have to invoke/run a shell file sample.sh from within perl file. When the perl while is executing, it should run to...
2
by: mayurshah01 | last post by:
Hey guyz, I'm leaning c++. i wanna execute *.exe file using c++ pogramming. For example I have four *.exe files, a.exe b.exe c.ece d.exe Now i'll ask user for option that which file he/she...
4
by: pizzetta72 | last post by:
Hi all, i just finish to install cygwin on windows XP adding also gcc compiler module. After I tried to execute a file called fstsg.0.3-sparc (www.fstha.com) used to cript a Unix shell, I receive...
4
by: balnair | last post by:
I have a shell file in location /home/transfer/check.sh I need to excecute this shell file using python script
1
by: Yogesh Sankar | last post by:
hi, i create setup deployment project and try to execute executable file placed in application folder directly after setup deployment complete..i succeed to place shortcut of that executable file on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.