Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2019 11:37:23 +0100
From:      Jan Martin Mikkelsen <janm@transactionware.com>
To:        =?utf-8?Q?Trond_Endrest=C3=B8l?= <Trond.Endrestol@fagskolen.gjovik.no>
Cc:        FreeBSD current <freebsd-current@freebsd.org>
Subject:   Re: ZFS no longer mounted in alphanumerical order
Message-ID:  <97B0EDCF-355F-4600-8316-2B12473445A4@transactionware.com>
In-Reply-To: <alpine.BSF.2.21.9999.1903121034570.315@mail.fig.ol.no>
References:  <201903120012.x2C0CeeJ012446@gndrsh.dnsmgr.net> <e45bc5ab-af40-ad75-b5b2-8b0830aa915a@FreeBSD.org> <alpine.BSF.2.21.9999.1903121034570.315@mail.fig.ol.no>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 12 Mar 2019, at 10:37, Trond Endrest=C3=B8l =
<Trond.Endrestol@fagskolen.gjovik.no> 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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?97B0EDCF-355F-4600-8316-2B12473445A4>