Created
May 29, 2013 04:04
-
-
Save NuckChorris/5667894 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/zsh | |
| while | |
| read data | |
| do | |
| if [[ -z $(echo $data | cut -f 3 -d :) ]]; then | |
| echo "$(tput setaf 3)[Error] $filename: bitrate not found$(tput sgr0)" | |
| else | |
| bitrate=$(echo $data | sed -r "s/.*,\s+([0-9]*) kbps.*/\1/") | |
| filename=$(echo $data | cut -f 1 -d :) | |
| if [ $bitrate -ne $bitrate ] 2>/dev/null; then | |
| echo "$(tput setaf 3)[Error] $filename: bitrate not a number$(tput sgr0)" | |
| elif (( $bitrate < $1 )); then | |
| echo "$(tput setaf 1)[Bad] $filename @ $bitrate$(tput sgr0)" | |
| else | |
| echo "$(tput setaf 2)[Good] $filename @ $bitrate" | |
| fi | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment