Ask Your Question
0

tidy doesn't remove "!()" matches

asked 2018-05-09 04:27:27 -0500

ivoR gravatar image

Hi Group

I try to remove all "ifcfg-" files except these where I need on the servers:

        tidy { "delete-unused-network-interfaces":
                path    => "/etc/sysconfig/network-scripts/",
                matches => [ "ifcfg-!(eth?|lo|bond?)" ],
                recurse => true,
                rmdirs  => false,
        }

But it doesn't remove any files, same content with

                matches => [ "ifcfg-eno?" ],

works, what I doing wrong?

gruss ivo

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2018-05-31 00:12:10 -0500

joshc gravatar image

Tidy's matches parameter only accepts file globs, not regexps.

edit flag offensive delete link more
-1

answered 2018-05-31 01:04:28 -0500

ivoR gravatar image

updated 2018-05-31 01:04:35 -0500

Salü joshc

Thank you for the answer, in the meantime I find out the same, but I can't find a solution to filter the file names out with globs.

I just will remove all files who starts with "ifcfg-", but not "ifcfg-eth?", "ifcfg-lo" and "ifcfg-bond?".

gruss sivo

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-05-09 04:27:27 -0500

Seen: 683 times

Last updated: May 31