ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi there again. Wonder if anyone could help. How can you prompt a user if they would like to perform either, add, subtract, multiply or divide when imputting two numbers?
For example i ask a user for a number, then i ask the user if they would like to use an add, multiply, subtract or divide operation to calculate a second integer.
Sorry im trying to edit the message but my internet keeps stopping. What i want to do is ask the user to input an integer then i ask the user if they would like to use either an add, subtract, multiply or divide function. then i ask the user for a second integer and the result will appear.
How would i be able to give the choice to the user of what calculation he/she would like?
You could use "select" to present choices or just use a plain "case".
how does everyone know how to do these things here??!!
Find neat script or have problem. Look at other people's code.
How do they do that? How am I gonna fix this? Write own code.
Reinstall Linux ;-p and find out hard way need reading: http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html then http://www.tldp.org/LDP/Bash-Beginne...tml/index.html finally http://www.tldp.org/LDP/abs/html/
Write own code. Reinstallation postponed by using "echo rm" instead of "rm" ;-p
Write some more. Typo scorches patch in side of computer casing.
Find out hard way need more examples. Search:
search LQ Bookmarks for bash and tutorial or guide
search LQ for "bash tutorial"
also see http://www.linuxquestions.org/questi...threadid=27957
and finally you can ask discuss things and ask questions ;-p
Difference is how much you want to leech vs learn.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.