Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: parse error in process substitution



On Nov 16,  9:18pm, Peter Stephenson wrote:
}
} I think they're more specialised than I previously assumed.  The one I
} was particularly aiming at was
} 
} % var="<foo><bar>"
} % print ${var##<([a-z]##|)>}
} <bar>

Ah, and hmm.  So:

schaefer[504] echo (<(echo|cat)|>(echo|cat))
zsh: bad pattern: (/proc/self/fd/11|/proc/self/fd/13)
schaefer[505] setopt nonomatch nocshnullglob
schaefer[506] echo ${:-(<(echo|cat)|>(echo|cat))}
(<(echo|cat)|>(echo|cat))
schaefer[507] echo ${~:-(<(echo|cat)|>(echo|cat))}
zsh: bad pattern: (<(echo|cat)|/proc/self/fd/12)
zsh: command not found: echocat

Something still seems a bit odd there.  Where did "echocat" come from?

Also there's this -- first, zsh-4.2.0:

schaefer<501> echo $(<(echo cat))                    
zsh: no such file or directory: (echo cat)

Now 4.3.9-dev-0 latest CVS:

schaefer[509] echo $(<(echo cat))                    
zsh: permission denied: /proc/self/fd/10

I wonder if the $(< ....) form should also be special-cased?

} I've allowed <(...) and >(...) to be expanded when sub = 0, but not when
} sub = 1, which is what happened before except only if the expansions
} were complete arguments, so I need to find a better description.
} "When parsing a string" is close but perhaps doesn't quite express it.

That also leaves unanswered the question of exactly what constitutes
"a string" ... is the shell grammar really completely documented enough
to make that discernible?

 
} > One last item ... perhaps you can explain what's going on here:
} > 
} > schaefer[518] cat <<(echo foo)what?
} > foo
} > schaefer[519]
} > 
} > I'm not sure exactly what I expected, but that wasn't it.
} 
} I haven't changed any of the parsing for redirections: they are handled
} separately.  So it looks like this is now inconsistent and needs fixing.

It used to produce a parse error.  I guess I was expecting that it
would now produce either a "no such file" or a "no match" error
because "/proc/self/fd/11what?" doesn't exist.
 
} Again, it's not clear why you would ever do that.

True, but the shell shouldn't silently discard typographical errors
unless somehow instructed to do so.

-- 



Messages sorted by: Reverse Date, Date, Thread, Author