C
chris
Background: I have a little program that scans pathnames and does
something worthile if a match is generated. Equally, I have a config
file with lines representing patterns to skip. To skip lines I have
the following (sort of):
if ($pathname =~ m,^$pattern$,) {;#skip it} else {;#do something
worthwhile}
Initially I want to skip home directories: '/home/.*' worked a treat.
Now I need to skip all, but not anything with '.ssh' in it.
so '/home/fred/.ssh' or '/home/tom/.ssh/known_hosts' is not excluded.
Now I know this must be simple but can I figure out a clean inverse of
'/home/.*?/.ssh'.
Any ideas gurus?
something worthile if a match is generated. Equally, I have a config
file with lines representing patterns to skip. To skip lines I have
the following (sort of):
if ($pathname =~ m,^$pattern$,) {;#skip it} else {;#do something
worthwhile}
Initially I want to skip home directories: '/home/.*' worked a treat.
Now I need to skip all, but not anything with '.ssh' in it.
so '/home/fred/.ssh' or '/home/tom/.ssh/known_hosts' is not excluded.
Now I know this must be simple but can I figure out a clean inverse of
'/home/.*?/.ssh'.
Any ideas gurus?