[TriLUG] bash question

Kevin Hunter hunteke at earlham.edu
Wed Oct 17 18:03:19 EDT 2007


At 1:40p -0400 on 17 Oct 2007, Magnus wrote:
> awk '{ print $4 }' /proc/partitions | grep -e '^[h,s]d.$'

This is by far the cleanest solution (although as discussed downthread,
won't necessarily give you all disks), but another way to construct many
matches in one clean statement is with the | (or) regex operator:

locate jpg | egrep -v 'king|queen|jack|png'
locate jpg | grep -Ev 'king|queen|jack|png'

Kevin

P.S.  Having been mucking around Windows all day as an admin, let me
just say that having the ability to string/pipe together all these
commands like this is such a relief!  Not perfect, but certainly more
elegant than the tools of which I'm currently aware in the Win*
environment.  Gotta love orthogonality of tools and simple interfaces!



More information about the TriLUG mailing list