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

Re: ulimit should limit the shell?



On Jun 29,  5:53pm, Zoltan Hidvegi wrote:
} Subject: ulimit should limit the shell?
}
} In other shells (bash, ksh93 and pdksh) ulimit affects the shell itself,
} not only child processes.  I think zsh ulimit should behave similarily.
} Even after ulimit is changed limit can still be used to set limits which
} affect child processes only.

According to zshbuiltins.1, `ulimit' affects child processes only, but
`limit' affects both zsh and its children.  Is this description wrong?

I believe the reason for the zsh behavior is that the zsh `limit' is
derived from csh/tcsh, where `ulimit' does not exist.  Why `ulimit' is
not simply a synonym for `limit' I do not know; `ulimit' got put in to
zsh during one of the stretches when I wasn't paying much attention to
the mailing list.

} I enable coredumps by defaults in my .zshrc to catch rare zsh bugs but
} this does not affect login shells so I have no coredumps when zsh crashes
} (fortunately this does not seem to occur recently).

If all you're worried about is having the ability to affect the shell
itself, use `limit' instead of `ulimit'.  If you're worried about the
ksh compatibility issue, I don't know of any shell other than zsh that
allows you to set limits for children differently from the limits of
the parent shell; so for all I care, the difference between `ulimit'
and `limit' can go away, or be made available only throug a switch
given to `ulimit'.

-- 
Bart Schaefer
schaefer@xxxxxxxxxx
http://www.well.com/www/barts




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