Sponsored Content
Full Discussion: arithemetic problem
Top Forums UNIX for Dummies Questions & Answers arithemetic problem Post 302072263 by anujairaj on Sunday 30th of April 2006 10:58:36 AM
Old 04-30-2006
Hi
I tried using the for loop,but I need to find the sum of numbers in a file,called temp.
This file has approx 85000 numbers in one column and i used :

for i in temp
do
total=`expr "$total + $i"|bc`
done

I debugged the script and got a null value for the "total",
I even tried using
for i in ` cat temp` ....

it kind of worked but is taking a loong time.and the file is 174 KB in size.
Is there anyway to find the sum in a shorter time ?
Any help will be appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with dd command or maybe AFS problem

Hi, folks. Sorry for bothering, but maybe someone could help me please. The problem is the following: there is some script that copies files from local file system to AFS. The copying is performed with dd command. The script copies data into some AFS volumes. The problem appeared with one... (0 Replies)
Discussion started by: Anta
0 Replies

2. Shell Programming and Scripting

awk - arithemetic functions with external variables

I'm trying to get awk to do arithmetic functions with external variables and I'm getting an error that I cannot figure out how to fix. Insight would be appreciated money=$1 rate1=$(awk -F"\t " '/'$converting'/{print $3}' convert.table) rate2=$(awk -F"\t"... (2 Replies)
Discussion started by: DKNUCKLES
2 Replies

3. Shell Programming and Scripting

Problem in arithemetic operation

Hi All, I am facing a problem while doing arithemetic operation My code pasted below. COUNT_BREAKTIME=`expr ($COUNT_TOTALTIME1 - $COUNT_AVGTIME) / $COUNTER` error is ./OFR_Break_Avgtime.sh: command substitution: line 30: syntax error near unexpected token `$COUNT_TOTALTIME1'... (3 Replies)
Discussion started by: subin_bala
3 Replies

4. Shell Programming and Scripting

ssh script problem problem

Hi Please help me with the following problem with my script. The following block of code is not repeating in the while loop and exiting after searching for first message. input_file ========== host001-01 host001-02 2008-07-23 13:02:04,651 ConnectionFactory - Setting session state... (2 Replies)
Discussion started by: pcjandyala
2 Replies

5. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

6. Red Hat

Mail Problem. Maybe, it is a DNS Problem!

Hi, i've a redhat linux 9 upadated by redhat from 7 version to 9 version. A couple of days ago i was a problem with my mail, in other words i'm not able to get any email nor to send any email. I've a proxy configuration and i tried to set iptables in order to verify the port. The 110,255 and 995... (1 Reply)
Discussion started by: pintalgi
1 Replies

7. AIX

AIX OS problem? network problem?

Dear ALL. I installed AIX OS on customer sites. but Only one site is too slow when I connected telnet, ftp.. Ping is too fast. but telnet and FTP is not connected.. of course i check the configuration file on aix but it's normal. Do any Idea?? thanks in advance. - Jun - (3 Replies)
Discussion started by: Jeon Jun Seok
3 Replies

8. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

9. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

10. IP Networking

Router problem or ISP problem ?

Hi everyone, I am experiencing discontinuity of Internet service, this started 1 month ago. Everything worked very well for 1 year of intensive use, but now, I have problems reaching my gateway. The gateway is not my router but a node belonging to my ISP and I share the same public IP with... (3 Replies)
Discussion started by: remic
3 Replies
groovyc(1)						      General Commands Manual							groovyc(1)

NAME
groovyc - compiler for groovy source files DESCRIPTION
usage: groovyc [options] <source-files> options: --classpath <path> Specify where to find the class files. -d <arg> Specify where to place generated class files. -e,--exception Print stack trace on error. --encoding <encoding> Specify the encoding of the user class files. -F <flag> -h,--help Print a synopsis of standard options. -j,--jointCompilation Attach javac compiler to compile .java files. -J <property=value> --sourcepath <path> Specify where to find the source files. --temp <temp> -v,--version Print the version. options: --classpath <path> Specify where to find the class files. -d <arg> Specify where to place generated class files. -e,--exception Print stack trace on error. --encoding <encoding> Specify the encoding of the user class files. -F <flag> -h,--help Print a synopsis of standard options. -j,--jointCompilation Attach javac compiler to compile .java files. -J <property=value> --sourcepath <path> Specify where to find the source files. --temp <temp> -v,--version Print the version. SEE ALSO
groovy(1) AUTHOR
This manual page was generated using help2man and edited by Varun Hiremath <varun@debian.org>, for the Debian project (but may be used by others). December 2007 groovyc(1)
All times are GMT -4. The time now is 05:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy