LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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


Reply
  Search this Thread
Old 12-01-2011, 06: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, 07:29 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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, 09:43 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
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, 09:48 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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, 11:25 AM   #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, 01:17 PM   #6
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
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



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 06:24 AM
Need help with shell scripts thorney Linux - Newbie 4 11-27-2005 11:18 PM
I Need shell scripts flyyy_82 Linux - Security 1 01-27-2005 04:05 PM
Shell scripts??? F_ANTHONY Programming 2 10-27-2004 06:28 PM
shell scripts... roofy Linux - Newbie 13 05-06-2003 06:06 PM

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

All times are GMT -5. The time now is 05:47 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