aspose file tools*
The moose likes Linux / UNIX and the fly likes ulimit -n not working from shell scrip Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "ulimit -n not working from shell scrip" Watch "ulimit -n not working from shell scrip" New topic
Author

ulimit -n not working from shell scrip

Srinivasa Maddi
Ranch Hand

Joined: Apr 18, 2007
Posts: 60
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

Joined: Sep 15, 2007
Posts: 294
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ulimit -n not working from shell scrip