Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ulimit -n not working from shell scrip

 
Srinivasa Maddi
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am working on hp unix machine. The following command from the unix command prompt(#) works well.

# ulimit -n 5000

But the same command when i try to execute through a unix shell script(.sh) its not working. So folks can anybody tell me how to write a unix shell script to execute the above ulimit command.
 
Doug Slattery
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srinivasa,

Originally posted by Srinivasa Maddi:
Hi,
I am working on hp unix machine. The following command from the unix command prompt(#) works well.

# ulimit -n 5000

But the same command when i try to execute through a unix shell script(.sh) its not working. So folks can anybody tell me how to write a unix shell script to execute the above ulimit command.


I'm not in front of a Unix machine right now to confirm this, but memory tells me that the ulimit will work for the child process the shell is executing in and not affect the parent (calling) shell.

Try this as a test:



If you name the test script ulim_test in your current directory, type the following to have it effect your login shell:

# . ./ulim_test

The . in front of the script name tells the shell not to spawn a child process to execute the command.

Hope this helps...
Aloha,
Doug

-- Nothing is impossible if I'mPossible
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic