You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* grep output is expected to show the filename if grep is searching many files, or in a recursive search (grep -r)
* The -h flag disables the filename prefix
* $Mult flag controls showing the filename, and was being set to 1 sometimes when it shouldn't be
* test1: "perl grep perl awk" --> show matches for 1 file (no filename prefix, single file argument)
* test2: "perl grep perl awk ar" --> matches for 2 files (filenames included)
* test3: "perl grep -h perl awk ar" --> matches for 2 files (filenames disabled by -h)
* test4: "perl grep -hr perl ." --> recursive search (filenames disabled)
* test5: "echo elmo | perl grep elm" --> show matches for stdin (no filename prefix, no file arguments)
* test6: "perl grep -l awk a*" --> show filenames matching awk
0 commit comments