Bob Stia wrote:
> Hello Sluggers,
>
> What is wrong with the following command? Trying to figure out how much to
> shrink down a movie.m2v Not a bash command?
>
> EasyStreet:/backup # factor = (6423971301/ (4600000000. - 232415232 ) ) * 1.04
> bash: syntax error near unexpected token `('
> EasyStreet:/backup #
>
If you have integers (not floats), you can do the following:
#!/bin/bash
(( factor = 6423971301/ (4600000000 - 232415232 ) ))
echo $factor
There's probably another way to handle floats, but this is what I'd
probably end up doing:
factor=$( echo 'scale=2; (6423971301/ (4600000000. - 232415232 ) ) *
1.04' | bc )
Using bc is a bit of cheating, but it's quick and dirty, and it works.
The "scale=2" means that you want two places to the right of the decimal.
-- - Ian C. Blenke <icblenke@nks.net>
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:21:51 EDT