$ help for
only mentions
for name [ [ in [ word ... ] ] ; ] do list ; done
and needs to be updated to mention
for (( expr1 ; expr2 ; expr3 )) ; do list ; done
$ echo $BASH_VERSION
5.1.8(1)-release
On Sun, Sep 19, 2021, at 3:25 PM, 積丹尼 Dan Jacobson wrote:
> $ help for
> only mentions
>for name [ [ in [ word ... ] ] ; ] do list ; done
> and needs to be updated to mention
>for (( expr1 ; expr2 ; expr3 )) ; do list ; done
Not particularly intuitive, but:
bash-5.1$ help 'for (('
On Sun, Sep 19, 2021, 4:07 PM Lawrence Velázquez wrote:
> On Sun, Sep 19, 2021, at 3:25 PM, 積丹尼 Dan Jacobson wrote:
> > $ help for
> > only mentions
> >for name [ [ in [ word ... ] ] ; ] do list ; done
> > and needs to be updated to mention
> >for (( expr1 ; expr2 ; expr3 )) ; do
OK, then "help for" should at least mention that trick to get the rest of
the story.
$ help f|wc -l
72
$ help fo |wc -l
24
$ help for |wc -l
10
$ help for\ |wc -l
14
$ help for\ \( |wc -l
14
$ help for\ \(\(|wc -l
14
So help help's 'If PATTERN is specified, gives detailed help on all
commands matching PATTERN." is not telling the whole story about
matching.
OK, so it first looks for exact hits,
then does a grep style match.
And we see that
$ help f|grep :.
false: false
fc: fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]
fg: fg [job_spec]
for: for NAME [in WORDS ... ] ; do COMMANDS; done
for ((: for (( exp1; exp2; exp3 )); do COMMANDS