Skip to content

Instantly share code, notes, and snippets.

@adrianocanofre
Created August 23, 2019 13:02
Show Gist options
  • Save adrianocanofre/d2d38d3b255ccaf5888379c2d49d90f6 to your computer and use it in GitHub Desktop.
Save adrianocanofre/d2d38d3b255ccaf5888379c2d49d90f6 to your computer and use it in GitHub Desktop.
calcula a transferencia de dados de um arquivo.
#!/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