Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Leonard <d+busybox@adaptive-enterprises.com>2023-01-29 05:07:08 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2023-03-28 19:08:02 +0300
commitd8a33603801476dd870ea66c36cf7c64d852d674 (patch)
tree9f4f45ee78d973bc10015b8e452e23ea88bcea1c /testsuite
parent2d4a3d9e6c1493a9520b907e07a41aca90cdfd94 (diff)
find: implement -ok
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html -ok utility_name [argument ...] ; The -ok primary shall be equivalent to -exec, except that the use of a <plus-sign> to punctuate the end of the primary expression need not be supported, and find shall request affirmation of the invocation of utility_name using the current file as an argument by writing to standard error as described in the STDERR section. If the response on standard input is affirmative, the utility shall be invoked. Otherwise, the command shall not be invoked and the value of the -ok operand shall be false. function old new delta do_exec 438 517 +79 parse_params 1833 1845 +12 static.params 288 292 +4 .rodata 100771 100775 +4 packed_usage 34543 34541 -2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 99/-2) Total: 97 bytes Signed-off-by: David Leonard <d+busybox@adaptive-enterprises.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/find.tests6
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/find.tests b/testsuite/find.tests
index 138236c81..d763ca6f2 100755
--- a/testsuite/find.tests
+++ b/testsuite/find.tests
@@ -28,6 +28,12 @@ testing "find -exec exitcode 2" \
"0\n" \
"" ""
SKIP=
+optional FEATURE_FIND_EXEC_OK
+testing "find -ok" \
+ "cd find.tempdir && find testfile -ok true {} ';' 2>&1; echo \$?" \
+ "true testfile ?0\n" \
+ "" "y"
+SKIP=
# Surprisingly, "-exec false ;" results in exitcode 0! "-exec false +" is different!!!
optional FEATURE_FIND_EXEC
testing "find -exec exitcode 3" \