Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15429

Re: Wrong command option in the manual examples

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Ole Tange <ole@tange.dk>
Newsgroups gnu.bash.bug
Subject Re: Wrong command option in the manual examples
Date Wed, 25 Sep 2019 20:11:46 +0200
Lines 60
Approved bug-bash@gnu.org
Message-ID <mailman.1098.1569435128.2190.bug-bash@gnu.org> (permalink)
References <CAD0rTC6EHd5w5A6kuD850mLzu+V_EJXQyoZ=amQcF9TktTSEJA@mail.gmail.com> <38052651-6d67-6107-660c-707ca39ee00c@case.edu> <59cf49b0-1292-b752-4fe8-8928fd558ebf@iki.fi> <3620768a-c85c-a95b-dae7-314145e2a0ed@case.edu> <CA+4vN7yKkoiNdYfJDteoOtDAqqvR8fpiAkX18EvcsgDm_+SnWw@mail.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
X-Trace usenet.stanford.edu 1569435128 17434 209.51.188.17 (25 Sep 2019 18:12:08 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Ilkka Virta <itvirta@iki.fi>, hk <hkadeveloper@gmail.com>, parallel <parallel@gnu.org>, bug-bash <bug-bash@gnu.org>
To Chet Ramey <chet.ramey@case.edu>
Envelope-to bug-bash@gnu.org
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RjumGAfOWv54uXYG4rt2wMEAjgMS3OT5ktfMHi2dlzw=; b=Bk+8dL2XGUaaQ7n34+gV3ISRSQbdRUGJ5KnHxLbsNoCkUWEmLsugJrdWsflrBVgbEo z7EoM+KiwiC5OlgQIxmvRfu2QkbxGrEVwwpWWT+lZvWAl1AloD9wz4pMFD0/aWKicT1C JNjhJRktAVAcdyRVITr6UkDZAnhdKcza01C8LGTeD5rd7np8uICHW9hbwtoXz9akYZx2 bCKHN2siLHvfYKIopXIcJmwpQAD2NgohNJIEB6LOqk7s8eJbh7tEZ/Tx9pkuVVm3Y6L1 UL4EOcBNkIdcrqQBWiFM/sughrCwmnauXHYzmvBO5xZL+esmVHQ4EDfFIFod90szm36X HKFw==
X-Gm-Message-State APjAAAXPdSjlLYiehI5wOfxF5QHNJOGRhltE0UhYtxagaSqV0UqxrwCC d17pQ37A0MGz9vvIEzEAtFtWrBLVr4u3aed2pw8=
X-Google-Smtp-Source APXvYqyF5tCuK44++/v/1x9fje4xsrx6q7DWTzlJZ1ZACROryue3vKbhdQnWzwVAkCxZUYhyaN9BB5YFz7cknrDOWeo=
X-Received by 2002:aca:53d4:: with SMTP id h203mr5361141oib.146.1569435119581; Wed, 25 Sep 2019 11:11:59 -0700 (PDT)
In-Reply-To <3620768a-c85c-a95b-dae7-314145e2a0ed@case.edu>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 209.85.167.171
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <CA+4vN7yKkoiNdYfJDteoOtDAqqvR8fpiAkX18EvcsgDm_+SnWw@mail.gmail.com>
X-Mailman-Original-References <CAD0rTC6EHd5w5A6kuD850mLzu+V_EJXQyoZ=amQcF9TktTSEJA@mail.gmail.com> <38052651-6d67-6107-660c-707ca39ee00c@case.edu> <59cf49b0-1292-b752-4fe8-8928fd558ebf@iki.fi> <3620768a-c85c-a95b-dae7-314145e2a0ed@case.edu>
Xref csiph.com gnu.bash.bug:15429

Show key headers only | View raw


On Mon, Sep 23, 2019 at 3:53 PM Chet Ramey <chet.ramey@case.edu> wrote:
>
> On 9/23/19 5:29 AM, Ilkka Virta wrote:
> > On 22.9. 21:15, Chet Ramey wrote:
> >> On 9/20/19 10:24 PM, hk wrote:
> >>
> >>> Description:
> >>>          On the section 3.2.6(GNU Parallel, page 16 in the pdf) of Bash
> >>> Reference Manual. The manual uses `find' command to illustrate
> >>> possible use cases of `parallel' as examples. but the option `-depth'
> >>> does not accept any argument, I think it means `-maxdepth` option
> >>> instead.

I think you are right. The goal is to emulate 'ls'.

As you can see from GNU Parallel's manual I would use printf instead:

    printf '%s\0' * | parallel -0 mv {} destdir

but I feel you are right that -depth should simply be replaced with -maxdepth.

> >> -depth n
> >>        True if the depth of the file relative to the starting point of
> >>        the traversal is n.
> >>
> >> It's not in POSIX, and maybe GNU find doesn't implement it.
> >
> > That seems to raise a question.
> >
> > Isn't Bash a GNU project? Would it be prudent to use other GNU tools in
> > examples, if standard POSIX features aren't sufficient?

I seem to recall when I became a GNU maintainer that it was a higher
priority to integrate nicely with other GNU tools than to integrate
with non-GNU tools. I cannot find the exact wording now, so it may
have changed.

I understood that such that in examples it would be encouraged to
prioritize GNU find over FreeBSD find, but that it would be fine to
include both. So it would go against my understanding of that if the
Bash manual promoted FreeBSD find over GNU find. This also strengthens
my belief that what is really meant is -maxdepth.

But if the GNU find people do not mind and FreeBSD find does not have
-maxdepth, then I would suggest simply using

    printf '%s\0' *

instead. It is shorter and IMHO easier to understand.

> > I can see that
> > FreeBSD find has '-depth n' (as well the standard '-depth', somewhat
> > confusingly) but should the reader of the manual be assumed to know the
> > options supported by BSD utilities?

If I recall the guidelines correctly: No.


/Ole

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Wrong command option in the manual examples Ole Tange <ole@tange.dk> - 2019-09-25 20:11 +0200

csiph-web