LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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


Reply
  Search this Thread
Old 12-01-2011, 07:08 AM   #1
jordan66
LQ Newbie
 
Registered: Dec 2011
Posts: 1

Rep: Reputation: Disabled
shell scripts


Hi Guys, I need your help with creating a script which will request the input of two numbers the script will perform different calculation on the received numbers. I am to add the two numbers, multiply the two numbers, subtract and divide the two numbers. The smallest number will be added to the big number until it equals the biggest number.
I need to use a while loop inside if structure.

Thanks heaps

very urgent please
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-01-2011, 08:29 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Hi and welcome to LQ.

If it's urgent to you, you must have already started writing the script. Can you post it so that we can help you with it?
 
2 members found this post helpful.
Old 12-01-2011, 10:43 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,258

Rep: Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436
Quote:
Originally Posted by jordan66 View Post
Hi Guys, I need your help with creating a script which will request the input of two numbers the script will perform different calculation on the received numbers. I am to add the two numbers, multiply the two numbers, subtract and divide the two numbers. The smallest number will be added to the big number until it equals the biggest number.
I need to use a while loop inside if structure.

Thanks heaps
very urgent please
Nope, not urgent for anyone here.

We are always glad to HELP you write a script, and work through a problem, but we're not going to do your homework for you. Post what you've written/tried, error(s) you're getting, and where you're stuck, and we'll help. Otherwise, you can find LOTS of bash scripting tutorials on Google:

http://tldp.org/LDP/abs/html/
 
Old 12-01-2011, 10:48 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You also need to be more exact in the requirements.
a script: Do you mean bash, perl, awk, python?

a number: Integer numbers, Floating point numbers?
 
1 members found this post helpful.
Old 12-01-2011, 12:25 PM   #5
goossen
Member
 
Registered: May 2006
Location: Bayern, Germany
Distribution: Many
Posts: 224

Rep: Reputation: 41
I recommend you first read TB0ne's link. The task is pretty simple, you only need to know the constructors.

If you need more help post here again showing what you have done and what is giving you trouble.
 
Old 12-01-2011, 02:17 PM   #6
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,376

Rep: Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959Reputation: 959
Always glad to help

1. see above on urgent. Urgent to whom and why?
2. we love to help, but we are not in the business of doing your homework for you.

This is a simple assignment.
 
  


Reply


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 ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 07:24 AM
Need help with shell scripts thorney Linux - Newbie 4 11-28-2005 12:18 AM
I Need shell scripts flyyy_82 Linux - Security 1 01-27-2005 05:05 PM
Shell scripts??? F_ANTHONY Programming 2 10-27-2004 07:28 PM
shell scripts... roofy Linux - Newbie 13 05-06-2003 07:06 PM

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

All times are GMT -5. The time now is 10:04 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration