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

Re: maintaining init files on a [t]csh influenced system



[Sorry about the earlier version of this message.  I goofed.]

>On the original question, though -- there are two major syntactic barriers
>to getting zsh to parse csh script files:
>
>1.  "set" commands, because they can do any of:
>    a.  assign to multiple boolean options in a single command
>    b.  mix assignments of option variables with string assignments
>    c.  use spaces around the "=" sign in any string assignment
>
>	set noclobber history = 50 nonomatch prompt="`hostname`: "
>
>2.  the "$?variable" syntax for testing whether a variable is set
>
>You can get zsh to parse just about everything else (*) by clever use of
>aliases and zsh functions, but I haven't figured out a workaround for
>either of the above.

$?variable would have to be supported by zsh itself, and would conflict
with the normal use of $?.  I think you could define a set function
that would do everything required, though.  (Check if argument is an
option and set it if so, check for separated = signs and join together
arguments as required.  It's actually not too difficult to write.)

>(*) "switch" statements are VERY entertaining, but possible (I think);
>    anybody care to guess how?

Please enlighten us.

-zefram



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