[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

doing operations with bash script

From: alphabah
Subject: doing operations with bash script
Date: Mon, 5 Mar 2012 14:59:14 -0800 (PST)

Dear all,

I am trying to do some operation within a bash script but I am running into
problems very early.

Say I want to do the following:
omegaNew=`echo "$omegaNew+$torque*$dt/$momentOfInertia*180/$pi" | bc -l`
I got these outputs:
torque= -0.0665625 dt= 0.0012 omegaNew= -.00026392835805117909
torque= 0.48041 dt= 0.000101208 omegaNew= -.00010327107397767696
(standard_in) 1: syntax error
torque= 1.14457 dt= 2.39891e-05 omegaNew=
Does this mean that the operation is not carried if the torque is not in the
form 0.******?
If so, why is that?

Another unrelated question:
I got this output message,
sed: -e expression #1, char 1: unknown command: `C'
even the command did what it was supposed to do (i.e., inserting a line)
whould one know how to get rid of this thing?

Best regards to all.

View this message in context: 
Sent from the Gnu - Bash mailing list archive at Nabble.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]