LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

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

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


Hi

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 ]
then
$number+$number.....

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

Rep: Reputation: 199Reputation: 199
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.

http://www.linuxquestions.org/rules.php
 
Old 03-04-2004, 01:49 PM   #3
Tengil
LQ Newbie
 
Registered: Mar 2004
Posts: 11

Original Poster
Rep: Reputation: 0
Ooops.. sry first time here
 
Old 03-04-2004, 01:58 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
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 06:48 PM
Using sed to add carriage retuns and line numbers. Optimistic Programming 11 04-08-2005 02:13 AM
Add consecutive numbers to a Chinese file tcma Linux - General 0 10-19-2004 04:25 PM
Adding numbers, break on non-numbers... Cruger Programming 1 03-22-2004 10:18 AM
Bash script: add all numbers from command output wi-Z-art Programming 2 08-06-2003 10:16 AM


All times are GMT -5. The time now is 01:15 AM.

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