Created
August 23, 2019 13:02
-
-
Save adrianocanofre/d2d38d3b255ccaf5888379c2d49d90f6 to your computer and use it in GitHub Desktop.
calcula a transferencia de dados de um arquivo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SIZE=$(stat --printf="%s" $1) | |
START=$(date +%s) | |
cp $1 $2 | |
END=$(date +%s) | |
DIFF=$(( $END - $START )) | |
TRANSFER=`echo "scale=0;$SIZE / $DIFF * 8 " | bc` | |
echo "Size: $SIZE" | |
echo "$TRANSFER Mbit/s" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment