Hi Axel!
* Axel Beckert <[email protected]>, 2015-09-06, 15:39:
When ack prints filenames, it strips leading "./". This is harmful
when you pass these filenames to another program, because a filename
starting with "--" might be interpreted as an option:
I'll forward it to upstream, but I wouldn't wonder if that will be a
wontfix from upstream, as ack is primarily intended for human use (and
not scripting) and there stripping is probably rather a feature and not
a bug.
OK, thanks.
$ ls
--interactive=.html
$ ack -f --html --print0 ./ | xargs -0 rm -f
rm: invalid argument ‘.html’ for ‘--interactive’
What about using this?
$ ack -f --html --print0 ./ | xargs -0 rm -f --
Yeah, but "--" is a GNUism. It works with rm, but not necessarily with
other tools.
--
Jakub Wilk