blob: a335e372039dd7f675a1ee1ec55d198d4d6cd831 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# ulimit: only what is safe to check everywhere.
case $(ulimit) in unlimited | [0-9]*) echo "default is -f" ;; esac
case $(ulimit -n) in [0-9]*) echo "-n is a number" ;; esac
[ "$(ulimit -f)" = "$(ulimit)" ] && echo same
(ulimit -n 32; ulimit -n)
(ulimit -S -n 40; ulimit -S -n; ulimit -H -n | grep -c .)
(ulimit -f 100; ulimit -f)
ulimit -a | grep -c -- '-n)'
ulimit -Z 2>/dev/null; echo "status=$?"
ulimit -n abc 2>/dev/null; echo "status=$?"
(ulimit -c 0; ulimit -c)
# A limit whose byte count does not fit rlim_t is refused, not wrapped to
# zero: 2^54 kbytes is 2^64 bytes, and it used to become a 0-byte stack.
(ulimit -s 18014398509481984) 2>err; echo "status=$?"
sed 's/^[^:]*: line [0-9]*: //' err
|