News for hackers. Stuff that matters.
Re:The apt command: Combining apt-get and apt-cache and adds... by matt_wulfeck on Saturday March 05, 2016 @12:15PM (#11230056)
I have this problem too. If I did myself shelling out to grep with pcre flags to find a simple library then there's a UX issue.
Re:The apt command: Combining apt-get and apt-cache and adds... by iam-TJ on Saturday March 05, 2016 @01:35PM (#11230388)
Search uses regular expressions so generally no need for grep unless you need more complex filters; --names-only has the -n short-form:

  apt-cache search -n <regexp>
More generally apt-get and apt-cache are designed to be backward-compatible for use in scripts whereas apt is not[0]:

  SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS

       The apt(8) commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use.
[0] http://manpages.ubuntu.com/manpages/xenial/en/man8/apt.8.htm...
Re:The apt command: Combining apt-get and apt-cache and adds... by matt_wulfeck on Sunday March 06, 2016 @01:02AM (#11232677)
Great tip thank you!
Re:The apt command: Combining apt-get and apt-cache and adds... by dsl on Saturday March 05, 2016 @01:09PM (#11230251)
> If I find myself shelling out to grep with pcre flags, I am using unix pipes as intended

Fixed that for you.

Re:The apt command: Combining apt-get and apt-cache and adds... by davvolun on Monday March 07, 2016 @04:57PM (#11242070)
Hmm...except that I would guess search should do one thing well -- searching. Which, incidentally, using --name-only and/or regex, it does.