[H-GEN] Shell script problem.

Byron Ellacott rodent at route-qn.uqnga.org.au
Thu Jun 4 21:33:46 EDT 1998


On Fri, Jun 05, 1998 at 11:08:30AM +1000, Chris Ryan wrote:
> > 14 3.63234e+07
> > 28 3.54324e+07
> > 36 3.34564e+07
> > 52 3.52345e+07
> 66 3.33333e+08
> Possibly. Maybe use sort with a separator of "+", on the 2nd column -
> this will give you the smallest exponential.  From there, sort the
> duplicates with a separator of " " - only do this for the first
> set of duplicates - haven't quite worked out how to do that.  
> The first entry after this is then your answer.
to get the first set of duplicates, a head+sed to get the exponent on
the first line, followed by a grep:

EXP=$(
  cat exponent-sorted-data | head -1 | sed 's/.*e+//'
)
cat exponent-sorted-data | grep $EXP | sort (after the " ") | head -1


----------------------- HUMBUG General List --------------------------------
echo "unsubscribe general" | mail majordomo at humbug.org.au # To Unsubscribe



More information about the General mailing list