22 Aug
2006
22 Aug
'06
11:20
I have the following script fragment:
tags=( $( vorbiscomment "$1") ) for tag in $(seq 0 $((${#tags[@]} - 1))) do echo ${tags[$tag]} done
sifs="$IFS"; IFS=' '; tags=(`vorbiscomment "$1")); IFS="$sifs"; for tag in "${tags[@]}"; do echo "$tag"; done;
which should extract the comments from the filename in $1 into the array $tags. So far so good. Unfortunately I find that the input is split up at spaces and line breaks, meaning that multi-word tags get distributed across more than one array element. Is there a way to get the assignment statement to break the vorbiscomment at line breaks only, or do I need to write a routine to put the broken lines back together?
Jan Engelhardt --