Created
September 8, 2015 17:39
-
-
Save adnelson/c399697a3cae6cb9a210 to your computer and use it in GitHub Desktop.
This should output something with PV, but it doesn't.
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
with import <pkgs>; | |
stdenv.mkDerivation { | |
name = "test_of_stuff"; | |
buildInputs = [python pv]; | |
buildCommand = '' | |
echo "doing some random stuff..." | |
cat <<EOF | python | |
import random, string, os | |
letters = string.letters + ' ' | |
f = open(os.path.join(os.environ['TMPDIR'], 'data.dat'), 'w') | |
for i in range(100000): | |
f.write(random.choice(letters)) | |
EOF | |
_size="$(du -sk $TMPDIR/data.dat | awk '{s+=$1} END {print s}')k" | |
tar -cf - $TMPDIR/data.dat | pv -pte -s $_size | gzip > $TMPDIR/data.tar.gz | |
ls -l $TMPDIR/data.* | |
echo "done" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment