SOS...on system command



I'm trying to store out put into the array the search for string in
this case truncating, but when I run the following command it prints
all the output before going to the foreach loop, it was my
understanding that the out put of the of the command will be saved
into @output then it can be searched, can some tell me where I go
wrong on this..thanks in advance...


my $sys = "dude";
my @output= `snmpwalk -c public -v 1 $sys .1 |grep \"truncating\"`;

foreach my $el (@output) {
next if ($el !=m~ ^\truncating\);
print " .................$el\n";
}
.



Relevant Pages

  • Re: SOS...on system command
    ... but when I run the following command it prints ... all the output before going to the foreach loop, ... understanding that the out put of the of the command will be saved ... generates output containing "truncating" on some lines. ...
    (comp.lang.perl.misc)
  • Re: SOS...on system command
    ... this case truncating, but when I run the following command it prints ... all the output before going to the foreach loop, ... understanding that the out put of the of the command will be saved ...
    (comp.lang.perl.misc)
  • TIP #185: Null Handling
    ... nulls, and command modifications for manipulating them. ... Tcl deals with strings, the universal medium for representing data. ... is know and it is an empty string, but if a respondent forgets to give ...
    (comp.lang.tcl)
  • Re: Determine how Word was launched
    ... inspect the command line used to launch Word. ... Private Declare Function GetCommandLineA Lib "kernel32" As Long ... Public Function GetCommandLineAs String ... Dim lngCmdLinePtr As Long ...
    (microsoft.public.office.developer.vba)
  • Re: Class.getMethod in classs static initializer block
    ... I just wanted to add that I had some similar code for a "command line server" project. ... static private final boolean DEBUG = true; ... {public ReturnCode runCommand(String s) ... public ReturnCode parseLine(String line) ...
    (comp.lang.java.programmer)