From owner-freebsd-questions@freebsd.org Wed Oct 25 14:27:27 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2BEBE4BC41 for ; Wed, 25 Oct 2017 14:27:27 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay14.qsc.de (mailrelay14.qsc.de [212.99.163.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E33896F289 for ; Wed, 25 Oct 2017 14:27:26 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay14.qsc.de; Wed, 25 Oct 2017 16:27:23 +0200 Received: from r56.edvax.de (port-92-195-74-193.dynamic.qsc.de [92.195.74.193]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id A0C5D3CBF9; Wed, 25 Oct 2017 16:27:19 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v9PERI7F002763; Wed, 25 Oct 2017 16:27:18 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Wed, 25 Oct 2017 16:27:18 +0200 From: Polytropon To: zep Cc: freebsd-questions@freebsd.org Subject: Re: A request to segregate man pages for shell built-ins Message-Id: <20171025162718.ccb5752f.freebsd@edvax.de> In-Reply-To: <590388f5-6c80-fe60-1370-a071ffef5649@gmail.com> References: <15f52853ee8.2787.c09309b3b9b6c7ba483efefa0c51d672@rail.eu.org> <20171025152240.b83f20e5.freebsd@edvax.de> <590388f5-6c80-fe60-1370-a071ffef5649@gmail.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay14.qsc.de with 0F05F743B4A X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.4501 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Oct 2017 14:27:27 -0000 On Wed, 25 Oct 2017 10:10:05 -0400, zep wrote: > On 10/25/2017 09:22 AM, Polytropon wrote: > > On Wed, 25 Oct 2017 08:03:03 +0000, Manish Jain wrote: > >> > >> On 10/25/17 13:23, Erwan DAVID wrote: > >>> That would mean doing a new section per shell eg (1bash) (1csh) (1zsh) > >>> each shell has its own builtins, Hicham can differ (compare set in bash > >>> and csh ) > >> Perhaps a new, unique section of man pages (something like section 99) > >> implemented for sh only and which can be called by any shell with the > >> same syntax : 'man 99 set' > > Or like pkg's "sub-manpages", with a hyphen: > > > > % man echo-csh > > > > compared to > > > > % man test-bash > > > > And for "identical implementations", compound manuals just as if > > you'd use "man 3 malloc" or "man 3 calloc" to take you to the same > > manual page. > > > > you could also build a 'smarter' man in such a case - e.g. as a shell > script wrapper kinda thing, it could do a which first, find out if the > shell you're currently running it from has a builtin, if there's a > binary, then chose the right one for how it's called and possibly > include a caveat about other versions. This is possible, but there is the following obstacle: A shell can invoke an external command or a builtin depending on execution context, i. e., if the shell is currently processing a shell script, the builtin will be used, but if it runs an interactive session, the external command will be called. I cannot remember what shell it was, but I encountered this strange behaviour once, many years ago: Something that worked at the command line didn't work the same way when used inside a shell script, even though the text was used 1:1. It was on some expensive UNIX nobody remembers anymore... ;-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...