09-18-2009
Exit Status 126 - how to get rid of it
Hi All,
I have a small application hosted on apache-tomcat 5. Basically its a html page which in turn calls a perl script residing on unix server. Through this perl script i am calling a shell script using system command , like
system('scriptname.sh',arg1,arg2,arg3);
Now in the script 'scriptname.sh' i am try to run a c-program executable which is compiled on unix itself.
The problem is that except that command[c-executable] all other statements gets executed.
On further investigation i found that , it is giving 126 as exit status which means "Command was found but could not be executed".
Can any of you experts please help me to come out of this problem
Thanks in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i downloaded a text file from metalab.unc.edu called sh.txt and in this reference manual it refers to shell scripting exit status .. at the end of one of the examples that author gave an exit status of 127..
to what does a 127 exit status refer too and what is its purpose in the code.
moxxx68 (1 Reply)
Discussion started by: moxxx68
1 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
i am writing a script to test if some servers are down and prompt if test positive. i used rlogin and rsh then exit but the script when run, logs into the servers and stays.
pls what can i do to salvage this? or what other options do you suggest? (6 Replies)
Discussion started by: sdcoms
6 Replies
3. Shell Programming and Scripting
I'm trying to write a script that will update a table in sysbase.
If it's failed then I want to rerun it one more time before exiting the script (fail due to bad value such as trying to put a string into datetime field or bad connection to the database)
Well my code below will always return... (2 Replies)
Discussion started by: sirrtuan
2 Replies
4. HP-UX
I have the question:
How return the exit code from then assign :
VAR=$(command ) for ex. VAR=$(ls ....)
VAREXIT=$?
echo $VAREXIT
VAREXIT is equal to 0 if the directory exist or not exist. WHI??
if i execute the command direct from line-command , the value of $? is different if... (1 Reply)
Discussion started by: ZINGARO
1 Replies
5. Shell Programming and Scripting
Hi all,
I'm running a program which return 1 upon success.
But when encounters problem shell return 's '1' .
How to differentiate between them the shell return value and script return value.
Ex. function fn return '1' if executed successfully and '0' if failed. But when if shell encounters... (1 Reply)
Discussion started by: yhacks
1 Replies
6. Shell Programming and Scripting
I'm preparing for exam and one of exams is to write own test command...
I wonder if in unix is a command which just returns exit code you specify..
I know I can easily write a function like this:
exStatus() {
return $1
}
-> my question is rather theoretical
thank you! (9 Replies)
Discussion started by: MartyIX
9 Replies
7. Shell Programming and Scripting
I am trying to get the exit status of grep and test a condition with it, But it does not seem to be working as expected since i am doing something wrong apparently
as per grep help
Exit status is 0 if match, 1 if no match,
and 2 if trouble.
My problem is something like this
templine - a... (7 Replies)
Discussion started by: prasbala
7 Replies
8. UNIX for Dummies Questions & Answers
what are the number for the exit status for command service and what does every number mean. (2 Replies)
Discussion started by: programAngel
2 Replies
9. Shell Programming and Scripting
I have a shell script (#!/bin/sh) that interacts with Appworx and Banner Admin. In my script I want to check the exit status of awrun before continuing. awrun can run for 10 seconds or it can run for over a minute. So my question is, will it go through my if statement before awrun may even be... (2 Replies)
Discussion started by: smkremer
2 Replies
10. Shell Programming and Scripting
Hi All,
I am trying to create a zip file with all the txt files(these are in large number) in the current directory. I am able to do this operation sucessfully.
After this i want to get the status of the tar command executed and do accordingly. When i am trying with the below code, the status... (3 Replies)
Discussion started by: paddu
3 Replies
LEARN ABOUT DEBIAN
runapp::apache
RunApp::Apache(3pm) User Contributed Perl Documentation RunApp::Apache(3pm)
NAME
RunApp::Apache - Apache control for RunApp
SYNOPSIS
use RunApp::Apache;
$apache = RunApp::Apache->new
(root => "/tmp/apache_run",
report => 1,
apxs => '/usr/local/sbin/apxs',
# httpd => '/usr/local/sbin/httpd',
required_modules => ["log_config", "alias", "perl", "mime"],
config_block => q{
[% IF AP_VERSION == 2 %]
eval { use Apache2 };
eval { use Apache::compat };
[% END %]
<Location /myapp>
AllowOverride None
SetHandler perl-script
PerlSetVar approot [% cwd %]
PerlHandler MyApp
Options +ExecCGI
</Location>
});
DESCRIPTION
This is the class for defining a apache web server to be used in RunApp.
CONSTRUCTOR
new (%arg)
Required arg:
root
The root for the apache instance.
apxs
httpd
If "apxs" is specified, "httpd" will be derived from it.
required_modules
A arrayref to the apache modules required.
config_block
The config block that will be the extra block in the template used by RunApp::Template::Apache.
CTL The class for handling apachectl. The default is RunApp::Control::AppControl. You can also use RunApp::Control::ApacheCtl.
CONF
The class for handling apache config. The default is RunApp::Template::Apache. It is used in the "build" phase of RunApp
SEE ALSO
RunApp, RunApp::Control::Apache, RunApp::Template::Apache, App::Control
AUTHORS
Chia-liang Kao <clkao@clkao.org>
Refactored from works by Leon Brocard <acme@astray.com> and Tom Insam <tinsam@fotango.com>.
COPYRIGHT
Copyright (C) 2002-5, Fotango Ltd.
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
perl v5.8.8 2008-01-09 RunApp::Apache(3pm)