ldapsudoers

LDAP sudoers sudoHost wildcards


I'm trying to use "sudoHost" to match a sequence of hostname on sudoers LDAP. Does anybody knows how to grep for this:

1080s.....1089s?

I try testing on bash and I don't seem to work.

grep  "[1082s-1089s]" devtech

I will greatly appreciate any hints Thank you


Solution

  • Is this an openldap sudoers question or a grep question?

    If you have the following lines within a file called devtech:

    1079s
    1080s
    1081s
    1082s
    ...
    1089s
    1090s

    And you want to match just those entries you specified, the grep regex would look like this:

    grep -E '^108[0-9]s$' devtech
    

    I included the start (^) and end ($) of line markers just to be absolutely explicit, but you don't strictly need them (unless you're afraid of matching '11085s').