I am trying to build shell command in with bahs loop from a file.
I have file with contents like this:
artist="artist"
title="title"
composer=""
and loop like this:
grep -v '=""' "$dir/input.file" | while read line || [[ -n $line ]];
do
tag+="-metadata ${line} ";
echo $tag;
done
echo "ffmpeg -n -i "$dir/$file" -loglevel error -map_metadata 0 $tag";
while in a loop it works fine:
-metadata artist="artist"
-metadata artist="artist" -metadata title="title"
however final output does not contain what was build in loop
ffmpeg -n -i /somepath -loglevel error -map_metadata 0
what am i doing wrong?