I have a list of files that I want to loop over....for example:
using the script
where firstslice is 40 and lastslice is 43 and 0.3 is the difference in z-cordinate btw the files.
My problem is that the script works fine with the exception that bash doesn't recognize $zposition. It apparently can't handle iteration with floating numbers? Can someone help?
Humm, I have looked at this shell script a few times and scratched my head.
You set the variable 'q' to a string
yet you expect to be able to subtract a number from it
How is this meant to work?
Hi,
I revisited it too and scratched my head as well! There's a bug in the script...if firstslice is bigger than lastslice it won't work. So I've tried a different tack using awk.
as a reminder, this is what I want to do; I have a list of files:
I want to loop through these files keeping their labelling intact. For example, I want to do in a single script
I have hundreds of these files and I need to carry out other non-trivial operations on them. Problem is bash does not recognize floating numbers so I can't loop over them.
my new script is :
So running this script and entering at prompts "40" , "43", "11.70"
loops over the 4 files nicely. But I don't know how to incorporate the output into the last line of the script so that awk recognizes the filename.
I have the following code snippet in bash
if ]; then
minm=`echo "$diff" | bc`
fi
It works well for most of the cases. However lets say diff is -0.17 and minm is -0.0017. In such a case the comparison seems to fail. Is the correct way to compare a mixture of positive and... (12 Replies)
I have started using bash but this script which I am working on it, is in c chell. So here is my simple problem:
set x = 0.4124\0.234
echo $x
0.4124.0.234
Same operation in Bash gives me correct result in my terminal. So there is something with my c shell that is causing this behaviour.... (8 Replies)
Hi guys
I have problem with my simple calculator, author of my book wrote
One way I tried is to test if one the inpur number is grater than zero, and then substatct
And my protptype function is
#include <stdio.h>
int main(void) {
float a, b , result;
... (11 Replies)
Hi,
i want to add two decimal values to
$ set a= 12.4
$ set b=3.6
$ w=`expr $a - $b`
expr: non-numeric argument
or is there any other method to do this mathematics operation.
i need to use this into my script. (4 Replies)
Dear guys;
How can I get the ceiling value of any floating number using shell or awk scripts or functions.
Example:-
old values "7.2" or "7.8" or "7.5" --->>> ceiling function ---->>> new value "8".
BR (6 Replies)
Hai,
Can you please guide me, to compare the floating point numbers.
Eg.
If
then
echo "value1 is grater "
fi
This code is not working properly when i excuted with floating values or real numbers (13 Replies)
hi all, i have the following problem using awk in a script
i want to read the values from a column with real numbers and calculate the mean.the problem is that when i use a statement such as this
num = $4
i cant find a way to convert the variable from string to floating point to perform... (7 Replies)