> I'm still having trouble converting between real and integers in unix
> scripts. I'm now using bash and have a shell script that calculates a
> value using bc. The result is something like 322.5000.
> How can I convert this number to an integer, 322?
> Can anyone suggest a sed command that will delete everything in a line
> after and including the . ?
However, shell builtin variable editing is probably better,
say if you have the result in variable X just do something like
The %.* construct will discard everything after and including
the last period in X, if any. (With two %'s it'd delete
everything from the _first_ period, same thing in this case.)
Of course you could also have bc truncate it with 'scale=0'
before final output, if you only need the integer part anyway.