Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One liner for access split output?

Is there a better way to write this sort of stuff:

    $allnics = split( $interfaces, "," )
    $first_nic = $allnics[0]
    notify {"this system has interfaces $interfaces":}
    notify {"the first nic is $first_nic":}

I tried ...

   $first_nic = split( $interfaces, ",")[0]

... but got a syntax error.