I am using shellcheck to fix warnings in a sh script. The script checks for the hard fd limit with:
ulimit -H -n
It sets the soft fd limit with:
ulimit -n "$MAX_FD"
This generates the shellcheck warnings:
In POSIX sh, ulimit -H is not supported. [SC2039]
In POSIX sh, ulimit -n is not supported. [SC2039]
What is the portable way to both get the hard resource limit and set the soft resource limit in POSIX sh?