Search Results

Search: Posts Made By: vgersh99
14,779
Posted By vgersh99
Just sayin'....
Just sayin'....
14,779
Posted By vgersh99
paste -sd+ myFile | sed...
paste -sd+ myFile | sed 's/+\([+-]\)/\1/g;s/^+//'|bc


---------- Post updated at 10:01 AM ---------- Previous update was at 10:00 AM ----------


I did try it with Solaris' Bourne (/bin/sh) -...
14,779
Posted By vgersh99
not all ksh-s provide floating point arithmetics ...
not all ksh-s provide floating point arithmetics

This doesn't work with Solaris' Bourne shell (/bin/sh)
14,779
Posted By vgersh99
Most likely all other operations could be made...
Most likely all other operations could be made easier with awk as well, but if you insist....

#!/bin/ksh
#set -x

sum=0
while read num
do
num=$(echo $num|sed 's/+//g')
sum=$(echo "$sum...
14,779
Posted By vgersh99
instead of using while/read and grep/cut, why...
instead of using while/read and grep/cut, why don't use awk and do it ALL of it natively with one utility...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 04:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy