dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 06bcb3f1d319a2de22835e29341a4e53d6759f14
parent a71c017f92521f8c6c947891363bd4d0b04d606c
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 10 Jun 2020 19:54:25 +0200

Strip leading and trailing whitespace from track title

Diffstat:
M.local/bin/ffmpeg-split | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.local/bin/ffmpeg-split b/.local/bin/ffmpeg-split @@ -50,7 +50,8 @@ while [ "$i" -le "$tracks" ]; do match($0, /[0-9]+:[0-5][0-9]/) print(substr($0, RSTART, RLENGTH)) }}' "$1")" - title="$(sed -n "s/ *(*[0-9]*:*[0-9]*[0-9]:[0-9][0-9])*//;${i}p" "$1")" + title="$(sed -n "s/ *(*[0-9]*:*[0-9]*[0-9]:[0-9][0-9])*//; + s/^ *//;s/ *$//;${i}p" "$1")" if [ -z "$t_end" ]; then t_end="$(ffprobe "$2" 2>&1 | grep 'Duration: ' |\ sed 's/,.*//;s/.* //')"