[rancid] custom command table and grep

heasley heas at shrubbery.net
Wed Mar 6 18:32:40 UTC 2013


Wed, Mar 06, 2013 at 01:24:49AM -0700, Khurram Khan:
> Hello All,
> 
> I've got a device that I'm building a custom command table for and trying
> to grep out a ssh key that I don't want displayed in the configuration.
> When running the command from cli on the device, the syntax looks like:
> 
> show configuration | grep -v "ssh "
> 
> and the cli command does what it's supposed to.
> 
> How do I incorporate the start/end quotes in the command table? I've tried
> a couple of variations and the script errors out.
> 
> @commandtable = (
>         {'no timestamps'      => 'DoNothing' },
>         {'show configuration | grep -v "ssh "' => 'WriteTerm' },
> );

dont do it that way.  add your filter in WriteTerm, if you must.

> 
> Thanks in advance!

> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss



More information about the Rancid-discuss mailing list