Front page | perl.trainers |
Postings from April 2009
Re: Syntax query
Thread Previous
|
Thread Next
From:
Brad Lhotsky
Date:
April 15, 2009 06:38
Subject:
Re: Syntax query
Message ID:
20090415133820.GA15197@divisionbyzero.net
system() returns the exit code of the commands you executed. In this
case, your command was successful and thus your "zero" return.
http://tinyurl.com/chrdoo
If you're using Perl, you can do the processing that awk and grep are
doing as well.
On Wed, Apr 15, 2009 at 06:50:01PM +0530, Rajini Naidu wrote:
> Hi,
>
> I am trying to execute the below line in the perl program and returns a
> value 0.
>
> my $test2 = "";
> my $include = "file";
>
> $test2 = system("/usr/atria/bin/cleartool desc \$include | grep created |
> awk -F\" \" \'{print \$2}\' | cut -b 1-9 ");
>
> The value returned by $test2 is 0. I suspect grep and awk commands are not
> getting executed.
> Is there any thing wrong in the syntax ????
>
> -Rajini
>
>
--
Brad Lhotsky
Thread Previous
|
Thread Next