Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: collect, set, and analyze command outputs

by rjt (Curate)
on Oct 04, 2019 at 19:17 UTC ( [id://11107065]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my   @lines = `list cm device all-properties`;
    my @matches = grep { /configsync-ip/ } @lines;
    chomp @matches; # Remove trailing newlines
    
  2. or download this
    my @matches = grep { /configsync-ip/ } `list cm device all-properties`
    +;
    chomp @matches;
    
  3. or download this
    for (@matches) {
        my (undef, $ip) = split /\s+/;
        ... # Your code to deal with the IP here.
    }
    
  4. or download this
    my @ips = map { (split /\s+/)[1] } 
             grep { /configsync-ip/ } `list cm device all-properties`;
    
  5. or download this
    use List::MoreUtils qw/:all/;
    
    ...
        # $addr is the first line, e.g.:  address 1.1.1.1/24
        # $allow_service is the 2nd line:   allow-service all 
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11107065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-25 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found