3 ms·
I scanned until I saw `ls | egrep '.*_test\.(py|cc)' | xargs -d $'\n' -- rm`, and then stopped. This is a terrible idea[1][2]. [1] https://mywiki.wooledge.org/
by l0b0 5y ago
I scanned until I saw `ls | egrep '.*_test\.(py|cc)' | xargs -d $'\n' -- rm`, and then stopped. This is a terrible idea[1][2].
[1] https://mywiki.wooledge.org/ParsingLs https://mywiki.wooledge.org/ParsingLs
[2] https://unix.stackexchange.com/q/128985/3645 https://unix.stackexchange.com/q/128985/3645
- tyingq 5y agoI'm surprised the links don't mention find. The -print0 flag makes it safe for crazy filenames, which pairs with the xargs -0 flag, or the perl -0 flag, etc. And you have -maxdepth if you don't want it to trawl.