Answer the question
In order to leave comments, you need to log in
What utility can delete files specified in the configuration file?
What utility can be used to delete files specified in the configuration file like this:
```
/usr/share/locale/*
!/usr/share/locale/en*
```
So that you can specify both the files to delete and the files that need to be saved.
Answer the question
In order to leave comments, you need to log in
cat + grep + if/not + rm
Or do you want to roll out a ready-made script? )
You can use perl script...
#!/usr/bin/perl
use strict;
use warnings;
my $CFG;
open ($CFG,"<config.cfg") or die "Cannot open config file: $!";
while (<$CFG>) {
if (($_ =~ /^\!/)){
next;
} else {
my $string = $_;
chomp $string;
unlink $string;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question