The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-25-2008
naree naree is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 81
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
  #2 (permalink)  
Old 02-25-2008
manikantants manikantants is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 131
actually why do you need an array in this situation ?
variable 'total' itself will do right ?
  #3 (permalink)  
Old 02-25-2008
pankajd pankajd is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 19
how do i post(start) a new thread?

sorry this is not a reply..
but pl tell me how i can post my querries on the forum?
  #4 (permalink)  
Old 02-25-2008
naree naree is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 81
i cannot assign float point numbers to an array in solaris

yes mani we can even do with variable total itself. But if we want to do it with an array it is not going why ? please try solve my problem..
  #5 (permalink)  
Old 02-25-2008
jlliagre jlliagre is online now Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,387
What shell are you using ?
The first line of your script that should tell it is missing.
  #6 (permalink)  
Old 02-25-2008
naree naree is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 81
shell used

i m using bash shell

$bash --version

GNU bash, version 3.00.16(1)-release (sparc-sun-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.
  #7 (permalink)  
Old 02-26-2008
theenathayalan theenathayalan is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 1
to find exact match

Hi

I want to find the extact match using grep. Can anyone pls help:

my file has below content:

ABCD 123
^A\
XYZ 3564
ACVB 4324


I need to get those line with "^A\"


Thanks
Closed Thread

Bookmarks

Tags
solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0