Operating System - HP-UX
1826325 Members
3459 Online
109692 Solutions
New Discussion

Script is not running after installing patch...

 
SOLVED
Go to solution
Rgomes
Valued Contributor

Script is not running after installing patch...

Hi All,

Yesterday we installed 2 patches on our 11i server:
PHCO_28832 cumulative sh-posix(1) patch
PHCO_29816 rc(1M) scripts cumulative patch

After installing these patches, it seems one script is not running, after executing, it gives like below error message:

/home/test/bin/fru_script.shl[331]: 008: The specified number is not valid for this command.

What might be the problem?

Thanks in advance,
Richard
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Script is not running after installing patch...

Since you didn't bother to post the offending line, I'm going to have to ask my psychic, Miss Cleo, what she thinks might be the problem. She suggests that you have numeric values that begin with 0 that are interpreted to be octal rather than decimal so that for example 08 is interpreted to be an invalid octal number. The solution is to use the typeset command to force the type:
e.g. typeset -i10 myvar=08

Now when it is updated, $myvar will be correctly interpreted.

I thing the patch release notes for the rc commands mention something similar so look at the release notes.


If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Script is not running after installing patch...

I'm A. Clay's backup psychic(not really). I still can't figure it out without seeing line 331 of that script, possibly a little more.

Please post.

Thanks.

Keep on foruming.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rgomes
Valued Contributor

Re: Script is not running after installing patch...

Hi Clay and Steve, FYI:

line# 323 if [ -d $FRU_DIR/$FRU_DAY_DIR ]

line# 324 then RaiseError $FRU $TRACE_MSG $WARN_LEV "The directory $FRU_DAY_DIR already exist"

line# 325 cd $FRU_DIR/$FRU_DAY_DIR

line# 326 fru_num_dir_list=`ls -tla | grep "^d" | grep FRU | cut -c${OFFSET_DIR_NAME}- | sort -nr`

line# 327 current_fru_num=`echo $fru_num_dir_list | cut -f1 -d " "`

line# 328 if [ -n "$current_fru_num" ]

line# 329 then RaiseError $FRU $TRACE_MSG $WARN_LEV "The directory $current_fru_num already exist"

line# 330 #Assigns new FRU number directory

line# 331 (( current_fru_num = current_fru_num + 1 ))

line# 332 if [ $current_fru_num -gt $FRU_FILE_MAX ]

line# 333 then

line# 334 current_h_m_s=`date +%H" "%M" "%S`

line# 335 current_seg=`echo $current_h_m_s | awk '{sum=0;sum = $1*3600+$2*60+$3;printf "%d\n", sum}'`

line# 336 (( current_seg = $SECS_PER_DAY - current_seg ))



I tried with starting the script with
#!/usr/bin/sh <----1st line
export UNIX95=0 <----2nd line

Have fun,
Richard
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Script is not running after installing patch...

Insert a new line after 327 so that we can see the value of curr_fru_num.

echo "Current_fru_num = ${current_fru_num}"

It would also be a good idea to enclose ALL of your variables in {}'s so that $current_fru_num is expressed instead as ${current_fru_num}. This prevents possible misinterpreation when variables are jammed into one another and it represents better discipline and coding on the part of the developer.
If it ain't broke, I can fix that.
Juergen Tappe
Valued Contributor

Re: Script is not running after installing patch...

Try to change :
line# 331 (( current_fru_num = current_fru_num + 1 ))
to
current_fru_num=$((current_fru_num+1))

should work .....
Working together