![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems . |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can array store float point numbers | naree | SUN Solaris | 1 | 03-05-2008 06:59 AM |
| adding float numbers | strike | Shell Programming and Scripting | 5 | 08-29-2005 02:20 PM |
| problem with floating point numbers in awk | kanagias | Shell Programming and Scripting | 7 | 06-24-2005 03:14 PM |
| how to assign same mount point for file systems mounted on physical disks | Hitesh Shah | Filesystems, Disks and Memory | 6 | 04-19-2003 02:42 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
i cannot assign float point numbers to an array in solaris
total=0
declare -a sum[10] limit=`iostat -En | grep -i size | awk '{print $2}' | sed -e 's/GB//g' | wc -l` echo "Limit is equal to $limit" ara="`iostat -En | grep -i size | awk '{print $2}' | sed -e 's/GB//g'`" for (( i=1; i<=$limit; i++ )) do sum[$i]=`echo $ara | cut -d " " -f $i` echo ${sum[$i]} if [ $total -eq 0 ] then total=${sum[$i]} else total=`echo $total + echo ${sum[$i]} | bc` fi done echo "Total Hard Disk Size is $total" When i try to run this script it is shooting an error called Limit is equal to 4 18.11 0.00 ./totalhardisk.sh: line 11: [: 18.11: integer expression expected syntax error on line 1, teletype 18.11 ./totalhardisk.sh: line 11: [: -eq: unary operator expected syntax error on line 1, teletype 73.40 ./totalhardisk.sh: line 11: [: -eq: unary operator expected syntax error on line 1, teletype Total Hard Disk Size is Please help in this regard |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|