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

Here-doc glitch, and null commands



Hello there,
this is as of zsh-3.0.3-test4.

Here-documents inside command/process substitution won't behave
when they contain an unmatched single or double quote.  Complains
about "parse error near `$(<<__END__'.", and when entered inter-
actively, one is caught in `cmdsubst>'.  Example:

echo $(<<__END__
Doesn't work.
__END__)


Now that I'm thinking about it, `<<' in command position is a null
command.  Why isn't this too, but a parse error?

< <<__END__
Feed this to $NULLCMD.
__END__


And while I'm at it: to get sh/ksh-like behaviour, invoke as sh/ksh
or set NULLCMD to `:'.  In order to flag errors, more in csh's
spirit, one have to explicitly unset NULLCMD.  Built-in emulate
can't help, it doesn't change special parameters.

It's a mess, but all of this can be found in the documention.

Except that it doesn't mention that NULLCMD will be set to `:'
after invocation as sh/ksh.  Hence, wouldn't NULLCMD fit better in
as a special parameter "automatically set by the shell", which can
be assigned to, or something?

Regards,
--Thorsten



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