On Wednesday 26 May 2010 18:16:18 Brandon McCaig wrote:
> On Wed, May 26, 2010 at 9:43 AM, Andros Zuna wrote:
> > But how could I test if the command executes if the return value changes?
> > ...is there a unix command or other way that generates random/different
> > return values??
>
> The follo
On Wed, May 26, 2010 at 9:43 AM, Andros Zuna wrote:
> But how could I test if the command executes if the return value changes?
> ...is there a unix command or other way that generates random/different
> return values??
>
The following C program will return a pseudo-random value every time it's r
On May 26, 2010, at 9:43 AM, Andros Zuna wrote:
> Ok, I see, so the code should look somehow like this:
>
> #!
> /usr/bin/perl
>
> use
> warnings;
> use
> strict;
>
>
> $command = "ls
> -l";
^^ Strongly suggest you use full paths here.
>
> while (system($command) != 0)
> {
>my
> $c++
>
Ok, I see, so the code should look somehow like this:
#!
/usr/bin/perl
use
warnings;
use
strict;
$command = "ls
-l";
while (system($command) != 0)
{
my
$c++
}
But how could I test if the command executes if the return value changes?
...is there a unix command or other way that generates
On May 26, 2010, at 9:03 AM, Andros Zuna wrote:
> Hi,
> I did some few changes:
>
> #!
> /usr/bin/perl
>
> # use
> warnings;
> # use
> strict;
>
>
> $command = `ls
> -l`;
>
Looks like you're using backticks. Backticks actually causes perl to execute
the command inside them and return the o
Hi,
I did some few changes:
#!
/usr/bin/perl
# use
warnings;
# use
strict;
$command = `ls
-l`;
if (system($command) == 0)
{
}
elsif(system($command) != 0)
{
print "Failed to execute:
$?\n";
my
$c++
}
But I'm still not getting it right, this is my error output:
root@/user$ ./script.
while (system($command) != 0) {
}
Bob McConnell
-Original Message-
From: Andros Zuna [mailto:andros.z...@gmail.com]
Sent: Wednesday, May 26, 2010 8:57 AM
To: Chaitanya Yanamadala
Cc: beginners@perl.org
Subject: Re: Return value = 0
Hi,
Thank you for the tip Chaitanya
On Wednesday 26 May 2010 15:49:37 Andros Zuna wrote:
> Hi!
> I am trying to write a perl code that will retry the same command over
> and over again until the return value is 0.
> This is what I got for now:
>
> #! /usr/bin/perl
> use warnings;
> use strict;
>
> $command = 'ls -l';
>
> if (syste
Hi,
Thank you for the tip Chaitanya, but I still don't thik my script is working
correct!?
2010/5/26 Chaitanya Yanamadala
> u should give it as
> $command=`ls -la`;
>
>
> use the key on the top of TAB button with shift..
> *
> Chaitanya
>
> "A man can get discouraged many times but he is not a
u should give it as
$command=`ls -la`;
use the key on the top of TAB button with shift..
*
Chaitanya
"A man can get discouraged many times but he is not a failure until he stops
trying..."
"The difference between 'involvement' and 'commitment' is like an
eggs-and-ham breakfast: the chicken was
Hi!
I am trying to write a perl code that will retry the same command over
and over again until the return value is 0.
This is what I got for now:
#! /usr/bin/perl
use warnings;
use strict;
$command = 'ls -l';
if (system($command) == 0) {
}
elsif(system($command != 0)) {
print "Failed to execu
11 matches
Mail list logo