Forums Register Login

ulimit -n not working from shell scrip

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 6237 times.
Similar Threads
issue when calling shell script from java
Problems while executing unix script from Java...
Need help with Unix Scripts
Maximum Number of Sockets
URGENT - runtime.exec command doesn't execute on unix
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:29:14.