[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] Execute command



I sslug.programmering, skrev Arkanoid:
>  Kim Schulz wrote:
> > On Sun, 22 May 2005 16:21:07 +0200
> > Arkanoid <sslug@sslug> wrote:
> > 
> > 
> >>Hej
> >>
> >>Findes der en metode til at få perl til at eksekvere en bash-kommando
> >>og smide outputtet ind i en streng? F.eks uname -a?
> > 
> > 
> > noget ala 
> > $unameStreng = `uname -a`;
> 
>  Det prøvede jeg også... men det giver mig bare kommandoen i output:
> 
>  IRC::add_command_handler("fortune","fortune_msg");
>  sub fortune_msg {
>      my $name = IRC::get_info(1);
>      $fortune_cmd = '/usr/bin/fortune -s';
>      IRC::print ("\cC02Random fortune from $name:\r\n\cC11$fortune_cmd");
>  }
> 
>  Outputtet er noget ala:
>  Random fortune from Arkanoid:
>  /usr/bin/fortune -s
 
Du bruger ' og ikke ` .. du skal bruge den der sidder skråt over å, med
shift. Vi kalder den backticks tror jeg nok. 

Jesper


-- 
./Jesper Krogh, sslug@sslug, Jabber ID: sslug@sslug



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 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] *