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

Re: Group Perms - 2nd Thought - Even Needed?



As I think about ugo, I don't even know how much value group perms even provide. Perhaps some services use groups but really (and especially with sudo and doas), I'm starting to think the Unix/Linux group category may add more of a burden of complexity than a benefit. When Unix first started, the group perms might have been a novelty but in practical use, more than is useful. In that light, I thank zsh and compinit for leading me to this realization, so thank and I'll leave it to you to decide whether to disregarded my suggestion about groups (bur for me, groups are more trouble than worth:-) so, it's not a request). 
 
At any rate thank you again for the professional, clear, and thorough responses to my initial question about shell compatibility (and pardon all the emails). 
 
Greg McPherran 
On 08/24/2025 2:46 PM EDT Greg McPherran <gm@xxxxxxxxxxxxxxxx> wrote:
 
 
Thanks kindly for responses.
 
A different topic, I recently ran into the compaudit security flag. For some files and dirs, I use a group called "admin" with group writable. I offer the suggestion of allowing specified group(s) for autoload and anything else that would otherwise be flagged by compaudit.
 
Greg McPherran 
 
 
On 08/24/2025 11:08 AM EDT Mark J. Reed <markjreed@xxxxxxxxx> wrote:
 
 
There is a high degree of overlap among the extra-POSIX features of bash, ksh, and zsh, but the differences crop up very quickly - for instance with arrays. With some care you can write a script that works in all three shells, but if you aren't specifically trying to do that, a complex bash script is unlikely to work as-is in zsh. 
 
I use both bash and zsh - my interactive daily driver is zsh,  but almost anything I write for use in a system at work is bash. This is not uncommon in my experience. I do sometimes try out snippets of code intended for bash at the zsh prompt, and so have to tweak it, but the logic translates easily enough; I don't feel any need for syntax compatibility.

Mark J. Reed <markjreed@xxxxxxxxx>
 

On Sun, Aug 24, 2025 at 11:00 Lawrence Velázquez <larryv@xxxxxxx> wrote:
On Sun, Aug 24, 2025, at 12:48 AM, McPherran Web - Support wrote:
> Hi, friendly question/plug: Can zsh run most scripts that "bash" runs?

In sh/ksh emulation mode, it can run many scripts that bash can,
but I would consider "most scripts" to be an overstatement.

In default mode, it can only run the most drop-dead simple scripts
due to some fundamental differences in behavior.


> Is this capability as well as POSIX compatibility considered an
> important aspect of zsh?

Not really.  It's a low priority.


> (POSIX seems a bit limited, so perhaps
> inter-shell compatibility is more important in actual practice and
> usage.)

In general, zsh does not specifically aim for bash compatibility.

The sh/ksh emulation mode does accommodate some ksh features that
bash has adopted, but broadly speaking the further a script strays
from POSIX, the less likely it is that emulation can handle it
acceptably.

See the documentation for more details:

https://zsh.sourceforge.io/Doc/Release/Invocation.html#Compatibility
https://zsh.sourceforge.io/FAQ/zshfaq02.html#l10
https://zsh.sourceforge.io/FAQ/zshfaq02.html#l17


> As I say, it's a "plug" as well as a question so the "plug" is
> that in general I'd like to be able to use zsh in place of "bash" as
> much as possible. :-)

As far as running scripts is concerned, I don't think this goal is
feasible or worthwhile.  There are just too many scripts out there
that require bash features/bugs (whether by design or by accident).
Even for POSIX scripts, sh emulation is good but not comprehensive.


--
vq



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