I am trying to calculate the maximum number from four numbers input by the user. I have the following code, but it does not work. It says there's an error with the last line "done". Any help would be appreciated.
guys, I'm trying to read a stream of numbers from standard input like: 2 3 -3 10 44 9 -1. The line ends once it read -1, but for some reason I have an endless loop...
Heyas
Its been a while since i've done some math,
so out of curiousity and 'fun' i wanted to write a bash script doing that.
AFAIK: A prime number is defined by any number that is only dividable by 1 or itself.
AFAIK: Bash works only with integer numbers, which uses no coma seperation.
Prime Numbers are not EVEN
So at first a think of a function that helps to me skip every even number
read something about read here!
Synopsis
read [-ers] [-u fd] [-t timeout] [-p ] [-a ] [-n ] [-d ] [-i ] []
Description
The read builtin reads one line of data (text, user input, ...) from standard input or a supplied filedescriptor number into one or more variables named by .
I am making a simple Address Book app (targeting 4.2) that takes name, address, city, state, zip and phone.
I want to format the phone number input as a phone number (XXX) XXX-XXXX, but I need to pull the value out as a string so I can store it in my database when I save. How can i do this??
I have the EditText set for "phone number" input but that obviously doesn't do too much.
I know some very basic commands in Linux and am trying to write some scripts. I have written a function which evaluates the sum of last 2-digits in a 5-digit number. The function should concatenate this resultant sum in between the last 2-digits and return it. The reason I want to return this value is because I will be using this value in the other function.
I have to write a program in bash and I understand logically how to do it I just cant get in into code. The problem is this "Write a program called "multiply" to get two numbers from the user and calculate the first number times the second number and show the result.
You are only allowed to use loop and addition operator(+).
Hi,
I have a large file with 100,000+ lines.
Hi, I'm trying to make a program that prompts for input a certain number of times, like say the user inputs 5, it will prompt for other input five times. I get the number from the user, but how do I make a for loop that uses that variable instead of a number?
This is one of the things I tried, but it doesn't work. Any help please? Thank you!