Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Nov 2009 21:10:57 -0800
From:      perryh@pluto.rain.com
To:        psteele@maxiscale.com, olivermahmoudi@gmail.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Sorting a device list
Message-ID:  <4b1353e1.Hqijnn9ZCQbcoq8k%perryh@pluto.rain.com>
In-Reply-To: <6b4b2d2c0911291036v358eb322m5bdf470e450f78ba@mail.gmail.com>
References:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB33BBEAB5@MBX03.exg5.exghost.com> <87hbsexjd7.fsf@kobe.laptop> <7B9397B189EB6E46A5EE7B4C8A4BB7CB33BBEADA@MBX03.exg5.exghost.com> <6b4b2d2c0911291036v358eb322m5bdf470e450f78ba@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Oliver Mahmoudi <olivermahmoudi@gmail.com> wrote:
> you can try to delete the /dev/ad10 entry with sed and then just
> append it to the end manually using the printf(1) utility like so:
>
> # ls /dev/ad* | sed s/"\/dev\/ad10"// | grep "/dev/ad" && printf
> "/dev/ad10\n"

Or strip the non-numerics from the beginning of each line, and put
them back after sorting:

# pfx=/dev/ad ; ls -d1 ${pfx}* | sed "s;$pfx;;" | sort -n | sed "s;^;$pfx;"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4b1353e1.Hqijnn9ZCQbcoq8k%perryh>