1822229 Members
4157 Online
109642 Solutions
New Discussion юеВ

ERROR IN .PROFILE

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

ERROR IN .PROFILE

When I su to oracle I get the following error. The dba's want it fixed, I've tried but cant figure it out.
Here is the error:

.profile[63]: unlimited: The specified number is not valid for this command.


Here is the line of code in the .profile that calls oraenv.

# Locate "osh" and exec it if found
ULIMIT=`(ulimit) 2>/dev/null`

if [ $? = 0 -a "$ULIMIT" -lt 2113674 ] ; then


Any ideas, I am lost. This same code works on my other systems without the error.
UNIX IS GOOD
2 REPLIES 2
Steven Mertens
Trusted Contributor
Solution

Re: ERROR IN .PROFILE

hi,

probably because the $ulimit var contains the
string unlimited , and combining this with
-lt gives an error.

see man test

INTEGER1 -lt INTEGER2
INTEGER1 is less than INTEGER2

you can use only integers with -lt not strings.

regards

Steven
Ceesjan van Hattum
Esteemed Contributor

Re: ERROR IN .PROFILE

Hi,
I think Steven Mertens is correct. Very likely $ULIMIT"unlimited".
Check it by inserting:
echo "--$ULIMIT--"
befour the if then else.
In case it is a string, replace it by a negitve number, like:

The $? is not needed for the command, because it always gets some value, no matter its success, better to do:

ULIMIT=`(ulimit)2>/dev/null`
if [ "$ULIMIT" != "unlimited" -a "$ULIMIT" -lt 2113674 ] ; then

,if the left part of AND will be unsuccesfull, it will not complain about the right part of AND.

Success,
Ceesjan