Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

[ 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).


How about:

    grep Hardcover | grep Kindle


Yup, but I had meant in one command though, i.e.

  sed -n '/Kindle/{/Hardcover/p}'


awk '/Kindle/ && /Hardcover/'

awk doesn't have to be complicated ;)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: