-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2008-11-22 at 09:20 -0600, David C. Rankin wrote:
I am trying to pull the current driver out of the xorg.conf and I have come up with a non-elegant way to do it but I'm concerned that I'm limiting it by only grabbing 2 additional lines on either side of "Identifier" to search for the Driver. Here is what I have:
CURRENTDRIVER=$(grep -A2 -B2 Identifier[[:blank:]]*\"Device[[] /etc/X11/xorg.conf | grep Driver | awk --field-separator '"' '{ print $2 }')
Is there a cleaner way to do this?
Yep, cgrep. See: cgrep -i -e "section.*\"Device" +w EndSection /etc/X11/xorg.conf \ | cgrep -i Driver yields: Driver "nv" Where cgrep is "context grep", obtainable here: http://www.bell-labs.com/project/wwexptools/cgrep/ http://www.bell-labs.com/cgi-user/wwexptools/gensnapshot?cgrep - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkkoLFYACgkQtTMYHG2NR9WEyACgmRGn9gR4YZDmQlB+Rf6kIQok 7eEAn27Pq8Iz1rCEogf2gCwVLJKQJYw5 =oldO -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org