zsh-users
 help / color / mirror / code / Atom feed
* How to turn sh_word_split on for a single command
@ 1997-01-15 19:27 Alain Caron
  1997-01-16  8:44 ` Andrej Borsenkow
  0 siblings, 1 reply; 2+ messages in thread
From: Alain Caron @ 1997-01-15 19:27 UTC (permalink / raw)
  To: zsh-users



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
fail.

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.

Regards,

Alain Caron
alainc@nortel.ca


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to turn sh_word_split on for a single command
  1997-01-15 19:27 How to turn sh_word_split on for a single command Alain Caron
@ 1997-01-16  8:44 ` Andrej Borsenkow
  0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 1997-01-16  8:44 UTC (permalink / raw)
  To: Alain Caron; +Cc: zsh-users

On 15 Jan 1997, Alain Caron wrote:

> 
> 
> 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
> fail.
> 
> 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.
> 

Hmmm ...

% echo $ZSH_VERSION
3.1.0
% unsetopt | grep shwordsplit
shwordsplit
% cat =foo
#!/sbin/zsh
echo 'ls -x'
% eval `foo`
... output of ls -x follows ...

Could you be more specific about your command? E.g.
% CMD='ls -x'
% eval `$CMD`
zsh: command not found: ls -x

greetings

-------------------------------------------------------------------------
Andrej Borsenkow 		Fax:   +7 (095) 252 01 05
SNI ITS Moscow			Tel:   +7 (095) 252 13 88

NERV:  borsenkow.msk		E-Mail: borsenkow.msk@sni.de
-------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-01-16  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-15 19:27 How to turn sh_word_split on for a single command Alain Caron
1997-01-16  8:44 ` Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).