LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 12: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, 12:47 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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, 12: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, 12:58 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

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

Have a reread of the rules.
 
  


Closed 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 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:08 PM.

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
Open Source Consulting | Domain Registration