[PC-BSD Testing] 9.2 beta images, disk vendor names are cut off..

Lars Engels lars.engels at 0x20.net
Mon Aug 12 03:36:34 PDT 2013


On Sun, Aug 11, 2013 at 11:56:57AM -0600, Warner Losh wrote:
> 
> On Aug 11, 2013, at 10:20 AM, Sam Fourman Jr. wrote:
> 
> > On Sun, Aug 11, 2013 at 9:40 AM, Lars Engels <lars.engels at 0x20.net> wrote:
> >> Am 10.08.2013 16:37, schrieb Sam Fourman Jr.:
> >> 
> >>>> 
> >>>> Try this:
> >>>> 
> >>>> sysctl -n kern.disks | tr ' ' '\n' | sort -n | xargs
> >>>> 
> >>> 
> >>> it doesn't work... here is what I get returned
> >>> 
> >>> sysctl -n kern.disks | tr ' ' '\n' | sort -n | xargs
> >>> ada0 ada1 da0 da1 da10 da11 da12 da13 da14 da15 da16 da17 da18 da19
> >>> da2 da20 da21 da3 da4 da5 da6 da7 da8 da9
> >> 
> >> 
> >> You're right, sorry.
> >> But this one works:
> >> 
> >> sysctl -n kern.disks | tr ' ' '\n' | sort -n -k1.3  | xargs
> >> 
> >> That sorts numerical in the first column after the third character.
> > 
> > yes that does work
> > root at Ziggy:~ # sysctl -n kern.disks | tr ' ' '\n' | sort -n -k1.3  | xargs
> > ada0 ada1 da0 da1 da2 da3 da4 da5 da6 da7 da8 da9 da10 da11 da12 da13
> > da14 da15 da16 da17 da18 da19 da20 da21
> > root at Ziggy:~ #
> 
> It is only working on the da devices because it is a stable sort and the devices are almost in order before the sort.
> 
> Warner

Yeah, third and last try. :-))

echo da15 ad30 ad1 ad0 ada0 ada1 da0 da1 da10 da11 da12 da13 da14 da15
  da16 da17 da18 da19 da2 da20 da21 da3 da4 da5 da6 da7 da8 da9 |
  tr ' ' '\n' | sed 's/\([^0-9]*\)/\1 /' | sort +0 -1 +1n | tr -d ' '

Ugly, but functional. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.pcbsd.org/pipermail/testing/attachments/20130812/84007080/attachment.bin>


More information about the Testing mailing list