From owner-freebsd-current@freebsd.org Tue Mar 12 10:44:19 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 4C730152A9FE for ; Tue, 12 Mar 2019 10:44:19 +0000 (UTC) (envelope-from janm@transactionware.com) Received: from mail3.transactionware.com (mail.transactionware.com [203.14.245.7]) by mx1.freebsd.org (Postfix) with SMTP id 3419F88732 for ; Tue, 12 Mar 2019 10:44:17 +0000 (UTC) (envelope-from janm@transactionware.com) Received: (qmail 11663 invoked by uid 907); 12 Mar 2019 10:37:33 -0000 Received: from p54B736ED.dip0.t-ipconnect.de (HELO [192.168.7.2]) (84.183.54.237) (smtp-auth username janm, mechanism plain) by mail3.transactionware.com (qpsmtpd/0.84) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPSA; Tue, 12 Mar 2019 21:37:33 +1100 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: ZFS no longer mounted in alphanumerical order From: Jan Martin Mikkelsen In-Reply-To: Date: Tue, 12 Mar 2019 11:37:23 +0100 Cc: FreeBSD current Content-Transfer-Encoding: quoted-printable Message-Id: <97B0EDCF-355F-4600-8316-2B12473445A4@transactionware.com> References: <201903120012.x2C0CeeJ012446@gndrsh.dnsmgr.net> To: =?utf-8?Q?Trond_Endrest=C3=B8l?= X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 3419F88732 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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 10:44:19 -0000 > On 12 Mar 2019, at 10:37, Trond Endrest=C3=B8l = wrote: > I concocted a shell script, it looks promising: >=20 > #!/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. > #- >=20 > DF=3D/bin/df >=20 > ${DF} ${@} | grep ^Filesystem > ${DF} ${@} | grep -v ^Filesystem | sort -k 6 >=20 > # new-df.sh An alternative sort approach, which handles df arguments which change = the number of columns, and only invokes df once: ${DF} "$@" | awk '/^Filesystem/ { print; sort =3D "sort -k " NF } ! = /^Filesystem/ { print | sort }=E2=80=99 Regards, Jan.=