> On 12 Mar 2019, at 10:37, Trond Endrestøl <Trond.Endrestol_at_fagskolen.gjovik.no> wrote: > 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} ${_at_} | grep ^Filesystem > ${DF} ${_at_} | grep -v ^Filesystem | sort -k 6 > > # new-df.sh An alternative sort approach, which handles df arguments which change the number of columns, and only invokes df once: ${DF} "$_at_" | awk '/^Filesystem/ { print; sort = "sort -k " NF } ! /^Filesystem/ { print | sort }’ Regards, Jan.Received on Tue Mar 12 2019 - 09:44:19 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:20 UTC