All pastes #355688 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-02-14 17:29 UTC
rendered paste body
#!/bin/bash

LASTSIZE=`ls -s "$1" | cut -d" " -f1`

while true; do

sleep 1
SIZENOW=`ls -s "$1" | cut -d" " -f1`

echo $LASTSIZE $SIZENOW
let "DIFF= $SIZENOW-$LASTSIZE"

if [ $DIFF == 0 ]; then
 echo stalled.
# else echo File grows at $((`printf %1d $DIFF/1048576`)) MB/s

 else
 DIFF_IN_MB=$DIFF/1024
 echo File grows at $((`echo $DIFF/1024`)) Byte/s

fi

LASTSIZE=$SIZENOW

done