On Dec 15, 2007 12:22 PM, John W. Krahn <[EMAIL PROTECTED]> wrote:
snip
> > That depends on the version of C you are using. Given the lack of
> > other syntax in this short program I cannot tell if it is K&R C, ANSI
> > C, or C99. If he is using K&R C, that is a perfectly fine main
> > definition
On Saturday 15 December 2007 06:17, Chas. Owens wrote:
>
> On Dec 15, 2007 2:50 AM, John W. Krahn <[EMAIL PROTECTED]> wrote:
>
> > > $ cat test.c
> > > #include
> > >
> > > main () {
> >
> > In C the main function returns an int so that is not compliant with
> > the C standard[3]. It should be:
>
On Dec 15, 2007 2:50 AM, John W. Krahn <[EMAIL PROTECTED]> wrote:
snip
> > $ cat test.c
> > #include
> >
> > main () {
>
> In C the main function returns an int so that is not compliant with the
> C standard[3]. It should be:
>
> int main ( void ) {
>
> > printf("hello world");
snip
That dep
On Friday 14 December 2007 19:01, jeff pang wrote:
>
> --- "John W.Krahn" <[EMAIL PROTECTED]> wrote:
> >
> > No, you would have to do:
> >
> > if ( !system($touchcmd) && !system($chkstat) )
>
> I have thought that, if the unix command's author doesn't return a 0
> from the code, how will we get the
On Friday 14 December 2007 19:01, jeff pang wrote:
>
> --- "John W.Krahn" <[EMAIL PROTECTED]> wrote:
> >
> > No, you would have to do:
> >
> > if ( !system($touchcmd) && !system($chkstat) )
>
> I have thought that, if the unix command's author doesn't return a 0
> from the code, how will we get the
On Dec 14, 2007 10:01 PM, jeff pang <[EMAIL PROTECTED]> wrote:
snip
> When I complied it and run it:
>
> $ ./test
> hello world
>
> then get the value of $?:
>
> $ echo $?
> 1
>
> It's 1 not 0.
> How do you think about this case? :)
snip
If it is in-house, I would find the culprit and beat him or
--- "John W.Krahn" <[EMAIL PROTECTED]> wrote:
>
> No, you would have to do:
>
> if ( !system($touchcmd) && !system($chkstat) )
>
I have thought that, if the unix command's author doesn't return a 0
from the code, how will we get the result of a system command was
executed successfully or not?
On Friday 14 December 2007 11:55, Martin Barth wrote:
>
> tat do?
>
> sorry john,
> what do you mean by that? :(
>
> I took the code:
>
> #!/bin/perl
>
> $interfaces="Output - working interface";
> $chkstat="cat tmp";
> $touchcmd="touch test";
> if (system($touchcmd) && system($chkstat)) {
>
> from
tat do?
sorry john,
what do you mean by that? :(
I took the code:
#!/bin/perl
$interfaces="Output - working interface";
$chkstat="cat tmp";
$touchcmd="touch test";
if (system($touchcmd) && system($chkstat)) {
from the first e-mail
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
On Friday 14 December 2007 09:29, Martin Barth wrote:
>
> Hi
Hello,
> > Perhaps $touchcmd and $chkstat could be done in perl instead of
> > running them in an external process? What exactly do $touchcmd and
> > $chkstat do?
>
> $chkstat="cat tmp";
>
> The source looks to me that you only want to
Hi
> Perhaps $touchcmd and $chkstat could be done in perl instead of running
> them in an external process? What exactly do $touchcmd and $chkstat do?
$chkstat="cat tmp";
The source looks to me that you only want to see if the file is created or not?
you can simply call open(); to check this f
On Friday 14 December 2007 05:31, [EMAIL PROTECTED] wrote:
>
> Hello List,
Hello,
> I am having two conditions in the perl program. after the check it
> will be regenerated to a valid or notvalid file depending on the
> check.
>
> Checking " if (system($touchcmd) && system($chkstat)) " as conditi
On Dec 14, 2007 9:00 AM, <[EMAIL PROTECTED]> wrote:
> Thanks Jeff.
>
> How will this be considered.
>
> if(system(CondA) && system(CondB)) ...
>
> I am getting 0 as the $? RC...but goes to the else part of the if-statement.
> Both the conditions (Unix commands are executed). Is it taking the Cond
Digging on thisto make it work.
Thanks again.
- Original Message -
From: jeff pang <[EMAIL PROTECTED]>
Date: Friday, December 14, 2007 7:45 pm
Subject: Re: Perl loop
To: [EMAIL PROTECTED]
Cc: "beginners@perl.org"
> --- [EMAIL PROTECTED] wrote:
>
> &g
--- [EMAIL PROTECTED] wrote:
> Thanks Jeff.
>
> How will this be considered.
>
> if(system(CondA) && system(CondB)) ...
>
I'd better write it as:
system "cronA && cronB";
if ($? == 0 ) {
do something...
}
Best Regards,
Jeff (joy) Peng
___
---
From: jeff pang <[EMAIL PROTECTED]>
Date: Friday, December 14, 2007 7:09 pm
Subject: Re: Perl loop
To: [EMAIL PROTECTED], "beginners@perl.org"
> --- [EMAIL PROTECTED] wrote:
>
> >
> > Checking " if (system($touchcmd) && system($chkstat)) " a
--- [EMAIL PROTECTED] wrote:
>
> Checking " if (system($touchcmd) && system($chkstat)) " as
> condition. Is this a valid one? also was trying to get this done
> buy calling subroutine.
>
No. Generally when an unix command was executed successfully, it will
return 0. ie,
$ perl -le '$s = sys
17 matches
Mail list logo