Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- dotest() {
- format=${1##*.}
- case "$format" in
- gz) cmd=zcat ;;
- bz2) cmd=bzcat ;;
- lzma) cmd='lzmadec -c' ;;
- xz) cmd=xzcat ;;
- lz4) cmd=lz4cat ;;
- lzo) cmd='lzop -cd' ;;
- *) echo "Unsupported format $format"; return 1 ;;
- esac
- echo "Testing $format"
- for i in 1 2 3; do
- time -f '%e' $cmd $1 >/dev/null
- done
- }
- for f; do
- dotest $f
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement