#!/bin/bash VERSION="1.0" [ -z $1 ] && { echo echo "ExPoN's calc seconds v$VERSION" echo "Usage: mksec MP3.mp3..." echo exit 0 } echo "Calculating seconds..." seconds=$(sox "$1" -e stat 2>&1 | grep 'Length' | \ sed -e "s/[^0-9]*\([0-9][0-9]*\)\..*/\1/g") echo "$1 is $seconds sec" exit 0