6

Problem with simple regex in bash script

view full story
linux-howto

https://bbs.archlinux.org – Hello, I'm writing simple script to automate splitting and tagging audio files.Here's the code:#!/bin/bash cuefile=$1 extension=${cuefile##*.} basename=${cuefile%.*} if [[ $# -eq 1 ]] && [[ $extension = "cue" ]]; then if [ -e "$basename.flac" ]; then type="flac" elif [ -e "$basename.ape" ]; then type="ape" elif [ -e "$basename.wv" ]; then type="wv" elif [ -e "$basename.wav" ]; then type="wav" fi else echo "You can split only (HowTos)