* [Tue, Oct 16, 2012 at 09:17:00PM +0400] Michael Tokarev:
+test -n "$LIMITS" && setlimits $LIMITS

Can't you just do

test -n "$LIMITS" && ulimit $LIMITS

?

I guess so, if your /bin/sh is linked to bash or you only set one parameter or
the shebang line is changed to be /bin/bash or well, something else :).
Otherwise it can break when called with more than one parameter. At least it
does with dash (and I suspect with other susv3 shells too, but didn't checked):

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Mar  1  2012 /bin/sh -> dash
$ sh
$ ulimit -l 64 -n 2048
sh: 1: ulimit: too many arguments

Ciao,
Gian Piero.

PS: please note that it _does_ subtly break when called with something like:
    LIMITS="-H -l 128 -S -p 512"
but I guessed it doesn't make a lot of sense separately setting hard/soft
limits in this context.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to