3 ms·
Creating a text stream which you then pipe to a shell is a good way of debugging complex operations, especially potentially destructive ones that may need inspe
by barrkel 15y ago
Creating a text stream which you then pipe to a shell is a good way of debugging complex operations, especially potentially destructive ones that may need inspection to verify. It's a technique I use a lot, to the point that some of my more destructive scripts don't do anything - they just output shell commands, and it's up to me to pipe them to the shell.
- noodly 15y agoYou can achieve this also by using find and its -ok option, instead of -exec, that way find will ask for confirmation before doing anything.
- JOnAgain 15y agoThanks for the -ok option. was not aware -- but yeah, I've been a heavy user of -exec option for years, and it always blows my mind when people get crazy complicated xargs going.
- barrkel 15y agoThat's not the same thing at all; I could emulate that in a script with 'read' and 'if', but that's not what I do.