@neil Probably. I know that some people can do fantastic things using sed & awk. I never really felt the urge to do a deep dive and as I'm used to use Python for most of my tasks, this was always my tool of choice. But it's cool to solve these issues by using the tools that come with the OS.
Sorry, you cannot view this.
It may have been deleted, or you may not have permission to see it.
0 Boosts
0 Likes
This comment is unavailable — it may have been deleted or is not visible to you.
@neil In case your filenames ever contain spaces, tabs, or backslashes (any of which can mess up your while read loop), I recommend a different idiom:
while read -r; do rm -- "$REPLY"; done <both.txt
(The added -- is technically redundant here because the filenames come from find, so there is no chance of an initial - appearing in any filename.)
Alternatively:
xargs -d '\n' rm <both.txt
@neil I was never really into sed & awk. Always preferred to use Python for tasks like this. But good to see how you solved it.