in reply to [Resolved] Call to ulimit in perl's system() causes unexplainable behavior

Could this be an XY Problem? I.e. what is the underlying problem are you trying to solve? Why are you using ulimit instead of some other mechanism to limit the size of the file?

Are you sure that /bin/sh is the same as bash on both systems? For example, try system("/bin/bash","-c", "..."); to make it a little more explicit.

Have you checked if ulimit succeeds by looking at the exit code and running just ulimit -f?

Replies are listed 'Best First'.
Re^2: Call to ulimit in perl's system() causes unexplainable behavior
by chengiz5 (Novice) on Mar 04, 2014 at 15:41 UTC

    The explicit passing of shell did help, thank you. You are absolutely right. I obviously did some mistake with the shell scripting before - I apologize. I re-attempted #!/bin/sh \\ ulimit -f ... and it does write a 2560 byte file on RHEL6. So it's not perl at all, but bash doing different things depending on $0 (/bin/sh does point to bash on both). So I'll fix the code to pass the shell explicitly to system().

    Obvious now, but just to answer your question, ulimit does succeed on both.

    Thank you once again!