zsh-workers
 help / color / mirror / code / Atom feed
* Unsetting a variable that was not previously set [kind of update]
@ 2005-03-09 14:14 Michael Prokop
  2005-03-09 17:07 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Prokop @ 2005-03-09 14:14 UTC (permalink / raw)
  To: zsh-workers

Hello,

I noticed a "problem" when unsetting variable(s):

% cat foo1
#!/bin/sh -e
a=b
unset a && echo foo
unset a && echo bar
% ./foo1
foo

% cat foo2
#!/bin/sh -e
a=b
unset a && echo foo
unset c && echo bar
% ./foo2
foo


I found the thread "Unsetting a variable that was not previously
set" -> http://www.zsh.org/mla/users/2003/msg00312.html in the
zsh-ml-archive.

According to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297137
bash3, dash and posh handle it in another way than zsh does.

That's what Chet [from bash] said about bash's behaviour (according
to <URL:http://www.zsh.org/mla/users/2003/msg00314.html>) ->

|    I got a bug report or two, and decided that the new behavior is
|    what POSIX.2 intended.  It seems to be what sh has always
|    done.

As this behaviour broke the hotplug-system on my Linux
Live-CD-system where zsh is used as /bin/sh I would like to know if
this behaviour of zsh might be changed in future or if I should fix
such scripts on my own.

thx && regards,
-mika-
-- 
 ,'"`.         http://www.michael-prokop.at/
(  grml.org -» Linux for texttool-users and sysadmins
 `._,          http://www.grml.org/


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

end of thread, other threads:[~2005-03-09 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-09 14:14 Unsetting a variable that was not previously set [kind of update] Michael Prokop
2005-03-09 17:07 ` Peter Stephenson
2005-03-09 20:31   ` Michael Prokop

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