On Sun, 08 Aug 2004 11:37:01 -0400 "Hakim Z. Singhji" <[EMAIL PROTECTED]> wrote:
> do > # Use the bc utility in a here document to calculate the percentage of > # free and used swap space > > PERCENT_USED=$(bc <<EOF > scale=4 > ($SW_USED / $SW_TOTAL) * 100 > EOF > ) > > PERCENT_FREE=$(bc <<EOF > scale=4 > ($SW_FREE / $SW_TOTAL) * 100 > EOF > ) > ########################################################################## Which ksh are you running (/usr/local/bin/ksh{,93)) ? If you are really new to this sort of things, test them interactively with 'set -ux' options. horio shoichi BTW., it gave me a thing like this on 4.9-STABLE with /usr/local/bin/ksh. % ksh $ SW_USED=1 $ SW_TOTAL=3 $ PERCENT_USED=$(bc <<EOF > scale=4 > ($SW_USED / $SW_TOTAL) * 100 > EOF > ) $ echo $PERCENT_USED 33.3300 $ ^D % _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"