[EMAIL PROTECTED] wrote:
ok so $? states CHILD_ERROR or last status returned by the last ` `
command.
$! states yields the current value of errno
in shell if I say it will give me a true or false value.
cat /tmp/foo
if [ $? -eq 0 ]
then
echo yes command succeeded
else
echo no.
fi
In
ers
PMSubject
[EMAIL PROTECTED] wrote:
$exit_value = $? >> 8
$signal_num = $? & 127;
$dumped_core = $? & 128;
ok this helps, thanks! But, in my small block of code I am using $? >> 8
as so
system ("cat /tmp/used"); # /tmp/used does not exist so
this should return 0 for false in Perl and 1 fal
cc
02/28/2005 11:38 Perl Beginners
AM
[EMAIL PROTECTED] wrote:
It is difficult for me to bottom post as I am using Lnotes. Sorry.
See previous rants about this.
ok so yes In general, I thought:
SHELL 0= true
Perl 0 = false
SHELL 1 = false
Perl 1 = true
what do you mean "non zero is false in this context." b/c in general I
thoug
cc
02/28/2005 10:09 Perl Beginners
AMSubject
Please bottom post...
[EMAIL PROTECTED] wrote:
ok so $? states CHILD_ERROR or last status returned by the last ` `
command.
$! states yields the current value of errno
in shell if I say it will give me a true or false value.
cat /tmp/foo
if [ $? -eq 0 ]
then
echo yes command succeeded
els
Perl Beginners
02/27/2005 07:59 cc
PM
[EMAIL PROTECTED] wrote:
All,
am I using the correct method to get the return code whether a previous
line or command was 0 false or 1 true?
#!/usr/local/bin/perl -w
use strict;
use strict 'subs';
my $file = qq(/tmp/mbfree);
open (F, "+<$file") or die "unable to open file $file $!\n";
foreach () {
In article <[EMAIL PROTECTED]>, Ahmed Moustafa wrote:
> Hi All,
>
> I'm calling a Java application using "system". How can I know the return
> code of the called Java application?
perldoc -f system
(...)
The return value is the exit status of the program as returned by the
"wait" call. To g
here are two ways:
my $exit_code = system ($cmd);
system ($cmd);
print "exit code = $?\n";
/Jon
Ahmed Moustafa wrote:
>
> Hi All,
>
> I'm calling a Java application using "system". How can I know the return
> code of the called Java application?
>
> Your help will be appreciated so much.
>
Thanks, it worked or at least gave me an error and exited the batch file. The batch
files are difficult to work out if there are a lot (I have 12 or more files to check)
so I will probably do as you suggest (write a wrapper) once I have worked out how to
do it, and then I can return the error
On Mon, 1 Oct 2001 [EMAIL PROTECTED] wrote:
> I think my main problem is getting an eror out of perl which is
> recognised by a .bat file. I have set a return code in the program
> from a subroutine but it is not getting to the operating system.
You should use 'exit' to return a value from a Per
I think my main problem is getting an eror out of perl which is recognised by a .bat
file. I have set a return code in the program from a subroutine but it is not getting
to the operating system.
__SNIP__
while ()
{
chomp;
$length = length($_);
if ($length != $lp) {
print OU
You can use label and goto to achive this.
create a lable end of the batch file.
": FILE_ERROR
The check for the condition if it is false then use statement.
"GOTO FILE_ERROR".
This will send the cursor to last label. and will stop
you can instert a echo command also after this.
echo " Stopped
15 matches
Mail list logo