From owner-freebsd-current@freebsd.org Tue Mar 12 09:37:52 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A652F1527C09 for ; Tue, 12 Mar 2019 09:37:52 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E71DB85B09 for ; Tue, 12 Mar 2019 09:37:51 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.15.2/8.15.2) with ESMTP id x2C9bkPH079524 for ; Tue, 12 Mar 2019 10:37:46 +0100 (CET) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.15.2/8.15.2/Submit) with ESMTP id x2C9bkYP079521 for ; Tue, 12 Mar 2019 10:37:46 +0100 (CET) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Tue, 12 Mar 2019 10:37:46 +0100 (CET) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: FreeBSD current Subject: Re: ZFS no longer mounted in alphanumerical order In-Reply-To: Message-ID: References: <201903120012.x2C0CeeJ012446@gndrsh.dnsmgr.net> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.fig.ol.no X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2019 09:37:52 -0000 On Tue, 12 Mar 2019 08:54+0200, Andriy Gapon wrote: > On 12/03/2019 02:12, Rodney W. Grimes wrote: > >> On 11/03/2019 23:03, Freddie Cash wrote: > >>> Wouldn't it make more sense to teach df, du, "zfs list", and other things > >>> that list the mounted filesystems to use sorted output? > >> > >> | sort [desired options] > > > > Except that df and zfs list have a header that you have to deal with, > > which is not so easy to get sort to do the right things with out > > some hoop jumping. > > Like "| tail +2" ? > Or if it's just for visual inspection (as seems to be the case for the original > poster) just mentally filter out that line. > > >> P.S. > >> zfs list already supports sorting by a specific property. > > > > Perhaps make zfs list -s mountpoint a default? > > Why? I concocted a shell script, it looks promising: #!/bin/sh #- # Parallel mounting of ZFS filesystems leaves a chaotic listing of # mounted filesystems when viewed by df(1). # Separating the header from the remaining lines and sorting the # latter before recombining is a viable solution. #- DF=/bin/df ${DF} ${@} | grep ^Filesystem ${DF} ${@} | grep -v ^Filesystem | sort -k 6 # new-df.sh -- Trond.