News for hackers. Stuff that matters.
Re:We are stuck with egrep and fgrep (unless you like beatin... by teddyh on Thursday October 13, 2022 @12:32PM (#33193297)
If we are talking about interactive use, you could always use an alias.

But if we are talking about scripts, you should at least use "fgrep -- [a] < file". And if you’re adding an option anyway, you might as well use "grep -F -- [a] < file". Personally, I prefer using options, specifically long options, in scripts; meaning "grep --fixed-strings --regexp=[a] < file".

If you don’t do this, the script will fail spectacularly the day when the string happens to start with a hyphen (-).

Re:We are stuck with egrep and fgrep (unless you like beatin... by romeoblade on Thursday October 13, 2022 @04:49PM (#33196301)
I thought I was the only one who perfected long options! Are you me?

I've had coworkers call me out (not rude, just "hey you know you just use -l... instead of --longopt") on calls because I always use long options when available. I use the hyphen explanation all the time as I've ran into it a few times.

I also prefer CLI applications that are designed to use the "=" for arguments with long options. Applications which don't use "=" or respect it, irk me because the it's ambiguous... "Is that argument an argument or sub command" when looking through history.

Re:We are stuck with egrep and fgrep (unless you like beatin... by teddyh on Friday October 14, 2022 @07:16AM (#33202003)
I don’t always use long options interactively, only sometimes, but I certainly try to always use it in scripts, for readability.