On 08/07/12 19:28, David Haller wrote:
Hello,
On Sun, 08 Jul 2012, Patrick Shanahan wrote:
* lynn <lynn@steve-ss.com> [07-08-12 12:50]:
grep [7a] somefile finds all lines containing an a or a 7. Quoting: "[7a]" gives the same. a's and 7's.
I want to find [7a]
grep \]7a\]
*bzzzt* You'd need to use
grep \\\[7a\\\]
without quotes. Compare with e.g.:
$ printf 'a\nb [7a] c\nd 7\n' | grep \[7a\]
-dnh
Hi David Yeah, just tried it. The single quotes messes it up. This works with double quotes: grep "\[7a\]" /usr/local/samba/etc/smb.conf [7a] and so does yours without quotes: grep \\\[7a\\\] /usr/local/samba/etc/smb.conf [7a] Anything else seems to print either the whole of smb.conf or nothing. Thanks, L x -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org