Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Ole Tange 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: References: <38052651-6d67-6107-660c-707ca39ee00c@case.edu> <59cf49b0-1292-b752-4fe8-8928fd558ebf@iki.fi> <3620768a-c85c-a95b-dae7-314145e2a0ed@case.edu> 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 , hk , parallel , bug-bash To: Chet Ramey 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <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 On Mon, Sep 23, 2019 at 3:53 PM Chet Ramey 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