[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] PERL: Udfør kommando og returner output



Frank Nørvig <sslug@sslug> writes:

> my $retur = `mtx -f $robot first`;
> print "Output:".$retur."\n";

Hvis det, som Carsten siger, er fordi din kommando skriver ting ud på
stderr er det letteste at viderdirigerer stderr til stdout.

Det kan gøres med:

my $retur = `mtx -f $robot first 2>&1`;
print "Output:".$retur."\n";

Du kan så ikke se på $retur om det er kommet fra stdout eller
stderr. Hvis du vil have stderr og stdout adskilt skal du nok se på
modulet IPC::Open3


-- 
 Peter Makholm     |     If you can't do any damage as root, are you still
 sslug@sslug |                                          really root?
 http://hacking.dk |                       -- Derek Gladding about SELinux


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *