News for hackers. Stuff that matters.
Re:If you use GNU grep on text files, use the -a (--text) op... by kwoff on Tuesday April 21, 2020 @02:12PM (#22937659)
Also precede the file list by `--`. A very confusing thing can happen if a file happens to begin with a dash... (You can intersperse options like `-e pattern` among file names, if for some reason you wanted to do that.)
Re:If you use GNU grep on text files, use the -a (--text) op... by iforgotpassword on Tuesday April 21, 2020 @05:02PM (#22939303)
But that's not grep specific and generally a good idea, especially in scripts that get the file names from their command line, some input file or god knows where.
Re:If you use GNU grep on text files, use the -a (--text) op... by steerablesafe on Wednesday April 22, 2020 @03:35AM (#22943154)
If the command line utility doesn't support -- or equivalent then you can prepend "./" for untrusted filenames.