Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found what looks like the perfect script for this but getting errors. Hoping someone can see problem. I am running 12.04 Server.

Error is

awk: line 0: regular expression compile failed (missing '(')


awk: line 0: regular expression compile failed (missing '(')


The following tags have been found in the mp3s:

These tags are to be stripped:

Here is a the script obtained from savvyadmin

# Script name:
# Original Author: Ian of DarkStarShout Blog
# Site:
# Options slightly modified to liking of



#Determine tags present:
find . -iname "*.mp3" -exec eyeD3 --no-color -v {} \; > $indexfile
tagspresent=`sort -u $indexfile | awk -F\): '/^<.*$/ {print $1}' \
| uniq | awk -F\)\> '{print $1}' | awk -F\( '{print $(NF)}' \
| awk 'BEGIN {ORS=" "} {print $0}'`

rm $indexfile

#Determine tags to strip:
tostrip=`echo -n $tagspresent $oktags $oktags \
| awk 'BEGIN {RS=" "; ORS="\n"} {print $0}' | sort | uniq -u \
| awk 'BEGIN {ORS=" "} {print $0}'`

#Confirm action:
echo The following tags have been found in the mp3s:
echo $tagspresent
echo These tags are to be stripped:
echo $tostrip
echo -n Press enter to confirm, or Ctrl+C to cancel...
read dummy

#Strip 'em
stripstring=`echo $tostrip \
| awk 'BEGIN {FS="\n"; RS=" "} {print "--set-text-frame=" $1 ": "}'`

# First pass copies any v1.x tags to v2.3 and strips unwanted tag data.
# Second pass removes v1.x tags, since I don't like to use them.
# Without --no-tagging-time-frame, a new unwanted tag is added.  :-)

find . -iname "*.mp3" \
-exec eyeD3 --to-v2.3 --no-tagging-time-frame $stripstring {} \; \
-exec eyeD3 --remove-v1 --no-tagging-time-frame {} \; 

echo "Script complete!"
share|improve this question

Well it was a lot of searching before I posted the question but soon after that I read something that referred to gawk. After installing, the script ran perfectly. I highly recommend this method. Very fast.

Thank you to Takkat for showing me the correct way to post code.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.