[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
-ok not totally OK
From: |
jidanni |
Subject: |
-ok not totally OK |
Date: |
Tue, 14 Oct 2008 03:14:01 +0800 |
Regarding "-ok": if you want to type y but by mistake you type
anything else, you have to start all over again. Therefore there
should also be a "p" offered: "bring me back to the previous line
and ask me again".
By the way,
-ok command ;
Like -exec but ask the user first (on the standard
input); if the response does not start with `y' or `Y',
do not run the command, and return false. If the command
is run, its standard input is redirected from /dev/null.
Please add to this the reason why standard input is redirected from
/dev/null vs. -exec. (Otherwise seems just for spite.)
Also mention if one then indeed needs stdin, a workaround is
-ok true \; -exec, e.g.,
-ok true \; -exec ed {} \;
-ok true \; -exec mplayer {} \;
Also it seems an -ok + and -okdir + could be implemented just as there
now is -exec + and -execdir +.
P.S., add a word:
-exec command {} +
the total number of invocations of the command will ___usually___
be much less than the number of matched files.
e.g.,
$ find just_one_file -exec echo {} +
1 vs. 1: not "much less".
Also say "(see above)" else users won't know what you are talking about:
The environment variable LC_COLLATE ___(see above)___ has no effect on the
-ok action.
- -ok not totally OK,
jidanni <=