I have the following script:
#!/bin/sh echo "OUTPUT:" gcc temp.c echo "ACTOP" ulimit -t 1 ulimit -f 1024 ulimit -u 3 ./a.out > out.txt
The output I get is
OUTPUT: ACTOP ulimit: 7: Illegal option -u
But if I use
ulimit -u 3 in the terminal directly it works. The
-f options work fine however.
When I change the shebang to
#!/bin/bash it works, but now it refuses to execute code unless the no. of allowed processes > 132.
Anything less than ulimit -u 132 does not allow execution.
In the terminal directly I was able to work with
ulimit -u 3.