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

How to turn sh_word_split on for a single command

In my .zprofile, I have to use a command similar to this one in order
to set-up my environment.

eval `some_command | command_filter`

My problem is that some_command is written for ksh/sh and I do not
have the sh_word_split option set.  This causes the above command to

It complains with the following error message:
zsh: no such file or directory: /usr/bin/X11/resize -u
which is clearly because of the sh_word_split option unset.

As a work-around, I did the following:

setopt shwordsplit
eval `some_command | command_filter`
unsetopt shwordsplit

which works fine.  The problem with this is that it is not elegant and
can be potentially dangerous if ever change my mind about having
shwordsplit option unset.  I know I could query the original state of
the option and only to this setopt/unsetopt if the option was
originally unset.

By looking at the man page, I thought I could use something like this:

eval ${=$(some_command | command_filter)}

but it fails the same way.

I am using zsh 3.0.2 on a HP 715 with HP-UX 9.05.  Zsh has been
compiled with the native HP cc compiler.


Alain Caron

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