Web lists-archives.com

Re: sometimes i go huh (grep result)




On Mon, Aug 27, 2018 at 11:26:12AM -0400, Greg Wooledge wrote:
> On Mon, Aug 27, 2018 at 11:20:42AM -0400, Roberto C. Sánchez wrote:
> > env |grep [-]g
> 
> Fails if there is a file named -g in the current directory, as that
> matches the unquoted glob and causes it to expand.  Also fails if failglob
> is turned on, whether the file exists or not (fails differently in the
> two cases).
> 
> Also fails if nullglob is turned on, but that is definitely not
> recommended in interactive shells.
> 
Quite right.  In my haste I forgot the quotes:

env |grep '[-]g'

-- 
Roberto C. Sánchez