Code:$cmd = "grep \'sysObjectID.0\s+:{1}\s+CISCO-PRODUCTS-MIB!\' /database/configs/$kind/$device/system";
($stdout,$stderr) = $ssh->cmd("$cmd");
Printable View
Code:$cmd = "grep \'sysObjectID.0\s+:{1}\s+CISCO-PRODUCTS-MIB!\' /database/configs/$kind/$device/system";
($stdout,$stderr) = $ssh->cmd("$cmd");
I only dabbled in Perl enough to do very simple tasks and my knowledge of grep is nearly zero, but I would start by removing the single quotes around the first parameter. Even if they're needed, you shouldn't have to escape them - as in:
Should "sysObjectID.0" be "$sysObjectID.0"? I'm not sure if the '\s' is a command switch or a part of a regular expression, so I'm over my head with the rest of the command. I think you'd be better off asking this in a Unix/Linux forum. Good luck!Code:$cmd = "grep sysObjectID.0\s+:{1}\s+CISCO-PRODUCTS-MIB! /database/configs/$kind/$device/system";
($stdout,$stderr) = $ssh->cmd("$cmd");
I'm too lazy to try and decipher what it should do. Please, tell me what you expect the $cmd variable to contain, exactly.