Operating System - HP-UX
1834481 Members
2916 Online
110067 Solutions
New Discussion

ulimit system or environment variable

 
SOLVED
Go to solution
Shivkumar
Super Advisor

ulimit system or environment variable

Hi,

We wanted to set and use the value of ulimit as environment variable. Someone mentioned that ulimit is a system variable and hence can't be used as an environment variable.

I couldn't get his logic. We set the ulimit value in the script. Howerver, i want to understand why can't we set the value of ulimit as an environment variable in some file and source it in other script wherever needed ?

Thanks,
Shiv
3 REPLIES 3
Michael Steele_2
Honored Contributor
Solution

Re: ulimit system or environment variable

Hi Shiv:

Well you're absolutely right. And I also don't understand your friend's comment. 'ulimit' is set in /etc/profile by default but can also be changed from the command line. The man page explains this. Here's a good link which I got off the ITRC search engine. Have you tried the ITRC search engine? I find it invaluable.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1229636

Support Fatherhood - Stop Family Law
Jeeshan
Honored Contributor

Re: ulimit system or environment variable

Dennis Handly
Acclaimed Contributor

Re: ulimit system or environment variable

>We wanted to set and use the value of ulimit as environment variable.

There are N different values for ulimit, which were you interested in? ulimit -a

>Someone mentioned that ulimit is a system variable and hence can't be used as an environment variable.

ulimit is not a variable but is a shell builtin. You can set a different environment variable to any of the N values returned by the command.

>We set the ulimit value in the script. I want to understand why can't we set the value of ulimit as an environment variable in some file and source it in other script wherever needed?

Yes, you could do that but you would need to use the ulimit builtin to change its value.

Why are you interested in ulimit? Typically it is set in your .profile and left alone. Unless you want to set it smaller to prevent runaway processes from going crazy.