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. 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
3. Shell Programming and Scripting
Hi,
I need a help with arithmetic calculations in my script. I have two variables: a=17; b=1712
I want to perform ($a/$b)*100 with two decimals in the result.
I tried with following:
res=$((100*a/b))
res=`echo "scale=2; $a / $b" | bc`
But I am not getting the decimal values.... (4 Replies)
Discussion started by: karumudi7
4 Replies
4. Shell Programming and Scripting
Hi
want to do below mathematical calculations in shellscrip but it is not giving me the exact output.Please help me to solve this
price=95.3
price1=(20/100)*$price+$price
echo "price=$price1"
finally the output should display price=114.36
Thanks (5 Replies)
Discussion started by: aish11
5 Replies
5. 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
6. 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
7. Shell Programming and Scripting
Hi,
How can i do the mathematical calculations in bash shell?
Are the mathematical functions available in bash shell?
Ex:
pow
ceil
floor
sqrt (5 Replies)
Discussion started by: cola
5 Replies
8. Shell Programming and Scripting
I am writting a script in the ksh shell and am trying to find a way to report the total execution time of the script without requiring the user to specify the time function when executing the script.
Does anyone have any examples they have used. I have been setting up two date variables (one at... (1 Reply)
Discussion started by: Omar Bacha
1 Replies
9. Shell Programming and Scripting
Hello,
Please help for the following scenario:
1. Shell Scipt should receive 2 variables values (say a and b).
2. Within shell script, there should be division of those numbers (a/b).
3. The result should be whole number i.e. in case the result comes out to be 9.4, it should be returned as... (3 Replies)
Discussion started by: damansingh
3 Replies
10. Shell Programming and Scripting
I am trying to do a shell script to monitor if any files went through in the last hour.
There is a script in cron that runs every sec checking to see if a file is there and ftp the file out of this folder.
Now I just want to add a block of code that will check to see no files went in the last... (3 Replies)
Discussion started by: jonathan184
3 Replies