Xref: utzoo comp.unix.wizards:9468 comp.unix.questions:7654 Path: utzoo!attcan!uunet!pdn!pdnbah!wolfe From: wolfe@pdnbah.uucp (Mike Wolfe) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement (filenames, maybe) Message-ID: <3511@pdn.UUCP> Date: 17 Jun 88 13:44:13 GMT References: <1148@mcgill-vision.UUCP> <540@sering.cwi.nl> Sender: news@pdn.UUCP Reply-To: wolfe@pdnbah.UUCP (Mike Wolfe) Organization: Paradyne Corporation, Largo, Florida Lines: 33 In article <540@sering.cwi.nl> fmr@cwi.nl (Frank Rahmani) writes: >> Xref: mcvax comp.unix.wizards:8598 comp.unix.questions:6792 >> Posted: Fri Jun 10 05:29:43 1988 >> >> In article <8012@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: >> A real useful `tool', this, that works only on files. And only when >> you grep more than one file, so you get filenames (or happen to be able >> to remember which flag it is to make grep print filenames always, >> assuming of course that your grep has it). >... >... >that's the smallest of all problems, just include /dev/null as first >file to be searched >into your script like >grep [options] pattern /dev/null one_or_more_filenames Smallest of all problems? One of my pet peeves is the fact that certain commands will only print filenames if you give it more than one file. While the /dev/null ugliness is a suitable kludge for the grep case what about a case were you want to run something using xargs, something like sum. You don't want /dev/null repeated for each call. I know I can sed it out but that's just a kludge for a kludge and to me that's a red flag. I think that all commands of that type should allow you to force the filenames in output. I don't want to go back and change all the commands (UNIX++ a modest proposal ;-). I just wish people would keep this in mind when writing things in the future. ---- Mike Wolfe Paradyne Corporation, Mail stop LF-207 DOMAIN wolfe@pdn.UUCP PO Box 2826, 8550 Ulmerton Road UUCP ...!uunet!pdn!wolfe Largo, FL 34649-2826 PHONE (813) 530-8361