Thanks guys. I've nearly got it working.
FunkyRes, what does "if [ $? -eq 0 ]" mean?
Also, if anyone can help me figure out how to correct this problem, that would be great. "$fname" is the name of the file (including the path.) "$fname.tags" is the name of the metadata file created by metaflac.
Error:
Code:
-bash: ${{$fname}.tags[${N_vars}]%=*}: bad substitution
-bash: $(echo "${{$fname}.tags[${N_vars}]%=*}" | tr [:upper:] [:lower:])=${{$fname}.tags[${N_vars}]#*=}: bad substitution
Relevant code:
Code:
for N_vars in "$fname.tags"
do
export "$(echo "${{$fname}.tags[${N_vars}]%=*}" | tr [:upper:] [:lower:])=${{$fname}.tags[${N_vars}]#*=}"
done