[ EDIT - Two replies as original post had been edited by the time I posted the first. ]
> and as a sidenote, something i only found recently, but which is quite useful, a logical AND with egrep looks like
>
> egrep 'Hardcover.Kindle'
That's not a true logical AND since it won't pick up an entry with the text "Kindle Hardcover". Only entries with the word "Hardcover" eventually followed by "Kindle". To cover both cases you'd need:-
egrep 'Hardcover.*Kindle|Kindle.*Hardcover'
(Of course, someone will now show how this can be done in even fewer characters).
Comments
[ EDIT - Two replies as original post had been edited by the time I posted the first. ]
> and as a sidenote, something i only found recently, but which is quite useful, a logical AND with egrep looks like > > egrep 'Hardcover.Kindle'
That's not a true logical AND since it won't pick up an entry with the text "Kindle Hardcover". Only entries with the word "Hardcover" eventually followed by "Kindle". To cover both cases you'd need:-
(Of course, someone will now show how this can be done in even fewer characters).How about:
Yup, but I had meant in one command though, i.e.
awk '/Kindle/ && /Hardcover/'
awk doesn't have to be complicated ;)