chengiz5 has asked for the wisdom of the Perl Monks concerning the following question:
Here's a sample perl code:
system("rm -f x; ulimit -f 5; while [ 1 ]; do echo 1 >>x; done");
If I run this on Redhat EL6 (perl 5.10.1), I get a file that's 2560 bytes long. If I run it on Redhat EL5 (perl 5.8.8), I get a file that's 5120 bytes long.
If I run the command in the shell as opposed to via perl, I get a 5120 byte file on both platforms, on both sh and bash (I do know sh is a symbolic link to bash here, but figured it's worth a try since you can base behaviour on $0). This is consistent with bash ulimit documentation which states that blocks for -f are 1024 bytes long.
The really weird thing is I managed to call the 5.8 perl from RHEL5 on my RHEL6 system and it still made a 2560 byte file, so it's not dependent on the perl configuration.
So I am at a complete loss. I'd like to know:
Thank you very much.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Call to ulimit in perl's system() causes unexplainable behavior
by Anonymous Monk on Mar 04, 2014 at 15:04 UTC | |
by chengiz5 (Novice) on Mar 04, 2014 at 15:41 UTC | |
|
Re: Call to ulimit in perl's system() causes unexplainable behavior
by einhverfr (Friar) on Mar 04, 2014 at 15:26 UTC | |
by chengiz5 (Novice) on Mar 04, 2014 at 15:42 UTC | |
by karlgoethebier (Abbot) on Mar 04, 2014 at 19:50 UTC | |
|
Re: Call to ulimit in perl's system() causes unexplainable behavior
by Tux (Canon) on Mar 04, 2014 at 15:08 UTC |