$connection->send("$cmd\r"); if(length($cmd) > "25") { $cmd = substr($cmd, -20); } $connection->expect(8, '$cmd'); $connection->expect($timeout, $prompt); $data = $connection->exp_before(); print "Command DATA: \n$data\n"; #### cat /etc/testfile | awk '{ FS = ":" ; print $1 }' | grep -v '^[#*]' | grep -v '^$' #### ":" ; print $1 }' | grep -v '^[#*]' | grep -v '^$' < Command output 1 (... SNIP ...)Command output xx
## cat /etc/testfile | awk '{ FS = ":" ; print $1 }' | grep -v '^[#*]' | grep -v '^$' ##
## ":" ; print $1 }' | grep -v '^[#*]' | grep -v '^$' < Command output 1 (... SNIP ...)Command output xx