10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I want to perform a mathematical operation on column. Can anyone please help?
Here is the sample of operation to be performed:
123 996 100
123 996 200
123 996 200 2015-09-21
123 996 100
123 996 200
123 996 100
What I want is to multiple all values of column # 3 by 100 and... (3 Replies)
Discussion started by: Zaib
3 Replies
2. Shell Programming and Scripting
I'm writing a script that will read all the fields of a text file into an array(if they are numeric), while at the same time computing the minimum and maximum values from the file. After that I want to output the average of all the numbers in the array.
The first problem I'm having is that many... (10 Replies)
Discussion started by: ksmarine1980
10 Replies
3. Shell Programming and Scripting
Dear All,
I read some variables in a file and assigned as name for each of them.
If I do echo I am able to see the values as 1.0E-05,3.4,5.0E-03 etc,
Now I want to do some mathematical operations with them.
Lets say
1
1.0E-05*5.0E-03
expected ans is 5.0E-08
2
1.0E-05/5.0E-03
expected... (9 Replies)
Discussion started by: linuxUser_
9 Replies
4. Homework & Coursework Questions
Hello Guys,For my homework I must write a shell script to do this serie,
http://upload.wikimedia.org/math/f/8/f/f8f543d9ecd01c4ecca2a0b7bc1234a2.pngI know that I must use the "bc" for that, but for the script's itself i have no idea,(beginner)
Can you plz just help me for have some idea?... (1 Reply)
Discussion started by: hamed.samie
1 Replies
5. Homework & Coursework Questions
Hello Guys,For my homework I must write a shell script to do this serie,
http://upload.wikimedia.org/math/f/8/f/f8f543d9ecd01c4ecca2a0b7bc1234a2.pngI know that I must use the "bc" for that, but for the script's itself i have no idea,(beginner)
Can you plz just help me for have some idea?... (1 Reply)
Discussion started by: hamed.samie
1 Replies
6. Shell Programming and Scripting
Hi, I'm creating a loop that allows the user to enter any number, then their choice of operator and then another number until their operator choice is equal to =
But I am getting an error saying integer expression expected. Any explanation on why this is happening?
echo "Please enter a number"... (1 Reply)
Discussion started by: Addman1991
1 Replies
7. Shell Programming and Scripting
I am getting the error:
Runtime error (func=(main), adr=10): Divide by zero
When executing the mathematical expression:
echo "scale=2; 1-(0/0)"|bc
How to overcome this? (5 Replies)
Discussion started by: proactiveaditya
5 Replies
8. UNIX for Dummies Questions & Answers
I need to be able to use the current date and calculate 7 days ago to be stored in another variable to be passed to a file in my Unix shell script. I need the date in the following format:
date '+%m/%d/%Y'
or
05/16/2006
How do I calculate date minus 7 days or 1 week ago? (8 Replies)
Discussion started by: mitschcg
8 Replies
9. Shell Programming and Scripting
hi all,
was wondering if there is another way to do calculations in ksh scripts other than using bc ?? i am using a script to calculate average response time and my script errors out after running for a bit.
e.g code i am using :
averageTime=$(print "$totalTime / $numberOfEntries" |... (2 Replies)
Discussion started by: cesarNZ
2 Replies
10. UNIX for Dummies Questions & Answers
As expr is used for integer calculations, which command is used for float calculations. (1 Reply)
Discussion started by: sharmavr
1 Replies