Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 03-04-2004, 12:43 PM   #1
LQ Newbie
Registered: Mar 2004
Posts: 11

Rep: Reputation: 0
Question Help.. how do I add two numbers?


I'm trying to write a script that adds two or more numbers... what command should I use?

I've written something like this:

echo "Give me a number"
read number

if [ $number=Integer ]

PLZ help if u know how I should do it.
Old 03-04-2004, 12:47 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 232Reputation: 232Reputation: 232
You started this in this same forum, please do not start the same conversation or discussion more than once, keep it in the same thread.
Old 03-04-2004, 12:49 PM   #3
LQ Newbie
Registered: Mar 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Ooops.. sry first time here
Old 03-04-2004, 12:58 PM   #4
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
Trickykid's words are seconded

Have a reread of the rules.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add numbers in a formatted file via a bash script? zero79 Linux - General 8 12-24-2010 05:48 PM
Using sed to add carriage retuns and line numbers. Optimistic Programming 11 04-08-2005 01:13 AM
Add consecutive numbers to a Chinese file tcma Linux - General 0 10-19-2004 03:25 PM
Adding numbers, break on non-numbers... Cruger Programming 1 03-22-2004 09:18 AM
Bash script: add all numbers from command output wi-Z-art Programming 2 08-06-2003 09:16 AM

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration