1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:57:44 +00:00

find: Add the -ok option

This behaves identically to the `-exec` option but prompts the user
for confirmation before executing the specified command.

A command is executed if a line beginning with 'y' or 'Y' is entered
by the user. This matches the behavior of `find` on Linux and FreeBSD
when using the POSIX locale.
This commit is contained in:
Tim Ledbetter 2023-09-11 17:55:44 +01:00 committed by Sam Atkins
parent 2e9a28272e
commit 8f8354d9a0
2 changed files with 56 additions and 14 deletions

View file

@ -88,6 +88,11 @@ by the current user.
substituting the file path for any arguments specified as `{}`. The list of
arguments must be terminated by a semicolon. Checks if the command exits
successfully.
* `-ok command... ;`: Behaves identically to the `-exec` command, but will
prompt the user for confirmation before executing the given command. An
affirmative response is any response that begins with the 'y' character.
Any non-affirmative response will cause the command to not be executed and
the value returned by `-ok` to be false.
The commands can be combined to form complex expressions using the following
operators: