Hacker News new | ask | show | jobs
by kazinator 2111 days ago
grep was standardized around 1990 by POSIX.2. In the last 25 years, I haven't had any problems with the POSIX compatible flags of grep, so maybe those points are not so relevant.

Using grep for '$' without being aware that grep patterns are regular expressions ((g)lobal search for (re)gexp, and (p)rint), and redirecting the output to the printer without first seeing what it might be (e.g. with .. | head -50) is pretty stupid.

Consider that this person's idea of solving the problem of "move occurrences of $ character to a different location within the line" in a bunch of files was to begin by searching for lines containing those $ characters and sending that to a printer. What? How is the hard copy going to help? Are you going to sit there manually typing in those paths and looking for those line numbers, to do the edit? If that is really the VMS way, who wants anything to do with it?

2 comments

> Using grep for '$' without being aware that grep patterns are regular expressions

There's always `fgrep` or, IIRC, the POSIX-compliant `grep -F`.

More often than not, people don't want regular expressions.

I learned it as meaning—

Global Regular Expression Parser

that seemed plausible enough I never questioned it.