From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sun, 4 Oct 2009 06:11:18 +1100 From: Sam Watkins To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20091003191118.GD15021@nipl.net> References: <20091003160327.GA15021@nipl.net> <20091003184617.14C075B2E@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091003184617.14C075B2E@mail.bitblocks.com> User-Agent: Mutt/1.5.13 (2006-08-11) Subject: Re: [9fans] mishandling empty lists - let's fix it Topicbox-Message-UUID: 7d03f7a4-ead5-11e9-9d60-3106f5b1d025 On Sun, 04 Oct 2009 03:03:27 +1100 Sam Watkins wrote: > find -name '*.c' | xargs cat | cc - On Sat, Oct 03, 2009 at 11:46:16AM -0700, Bakul Shah wrote: > Your example doesn't hang (and if it does, your xargs is broken). hm sorry, I meant: cat `find -name *.c` | cc - > A common use of many tools is in a pipeline and having to type - every time > can get annoying. We could differentiate tools that work on stdin from tools that work on a list of files. Or each tool could default to one or the other. If a tool normally works on a list of files (like cat), it can also use stdin: cat - If a tool normally works on stdin (like sed), it can use a list of files: grep pattern : foo bar baz By the way, grep is even more inconsistent than usual: it only adds the file: prefix to matching lines when there are 2 or more files! I don't see how this can be fixed in unix without breaking umpteen million shell scripts. But perhaps this could be corrected in plan 9 or inferno which are still more experimental OSes; or we could keep it in mind for "plan 10". Sam