Home > Archive > PERL Beginners > July 2006 > command execution
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Irfan Sayed 2006-07-25, 3:57 am |
| Hi All,
I am executing following command
` $MT chreplica`;
I need to find out wheather this command is executing properly or not.
If it's executing properly then i need to print the message saying that
" command executed successfully"
Can anybody please help me.
Regards
Irfan.
| |
|
| Sayed, Irfan (Irfan) wrote:
> Hi All,
>
> I am executing following command
>
> ` $MT chreplica`;
>
> I need to find out wheather this command is executing properly or not.
>
> If it's executing properly then i need to print the message saying that
> " command executed successfully"
>
> Can anybody please help me.
>
> Regards
> Irfan.
>
The exit status of the command will be in $?
So check this one to get the result.
On success return 0 and for the failure some non-zero value
---
Prabu.M.A
| |
| David Romano 2006-07-25, 6:57 pm |
| Hi Irfan,
On 7/24/06, Sayed, Irfan (Irfan) <isayed@avaya.com> wrote:
> Hi All,
>
> I am executing following command
>
> ` $MT chreplica`;
>
> I need to find out wheather this command is executing properly or not.
From what I remember `` gives the output of the command pass in, and
since it looks like you're not assigning the output to a variable, you
might use the system() function to get its exit status. Check out the
perldoc for it, either by typing at the terminal:
perldoc -f system
or going to http://perldoc.perl.org/functions/system.html
HTH,
David
|
|
|
|
|