From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 5 Oct 2009 09:30:45 -0400 To: 9fans@9fans.net Message-ID: In-Reply-To: <<20091005055423.GA14691@nipl.net>> References: <<20091005055423.GA14691@nipl.net>> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [9fans] mishandling empty lists - let's fix it Topicbox-Message-UUID: 7eb42a2e-ead5-11e9-9d60-3106f5b1d025 > grep foo -- * > > will still not work because rc's globbing also fears zero and returns the > pattern instead of an empty list if there are no matches. i used to think that was a misfeature. in college i wrote a shell that elided failed globs in the argument list. the problem is that people assume that failed globs generate an error, e.g. cat «glob pattern» >[2=] || echo cat failed i didn't redesign the system, so that would hang with my shell. if we follow your redesign of unix, we would never get an error because cat * does nothing and wouldn't be an error at all. one would need to write x = * if(~ $#* 0) echo cat failed if not cat $x that seems less attractive to me. - erik