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

Re: Read-only variables in emulation mode



On Dec 16, 11:40am, Bart Schaefer wrote:
} Subject: Re: Read-only variables in emulation mode
}
} On Dec 16,  8:10pm, Oystein Walle wrote:
} } Subject: Read-only variables in emulation mode
} }
} } I assume status and _ are meant to be writable in POSIX shells.
} 
} Hmm.  According to the doc, "status" should be writable but "_" not.

I looked a bit more closely at this and found that when zsh is *started*
in POSIX shell mode (e.g., the executable name is sh or ksh), then the
"status" variable is non-special, as expected.

It's a known limitation that invoking "emulate ..." after the shell is
already running does completely re-instantiate POSIX mode.  This is not
likely to change.

However, I don't think there's any particular reason we couldn't remove
the readonly property from $_ if that would improve compatibility.



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