I'm trying to write a bash queue which will be able to load command sets from a file and then execute each over a set of files.The prepared file should serve as a template for execution in manual bash queuesprepared file sed.sh:(I have also comments in the file but i don't know how to add them here)sed -e 's,something_complex_long,something_even_longer,'sed -e 's,other_complex_long_thing,something_so_much_longer,'sed -e 's,another_long_stuff,something_hell_long,'and there is  directory with set of quite huge files with generic names such as aa ab ac etc. (sliced down even bigger file using split)So I tried:sedie=\`grep -v -e '^#' ../../sed.sh\`for i in *do  for b in $sedie  do    cat $i | $b > ${i}.new    mv ${i}.new $i  donedoneWhich of course totally failed, since the second for breaks up statements in $sedie by spaces.Then I tried to go along using IFS as I have found somewhere but still not much progress. Then I thought I should load the commands in some kind of array to help differentiate what I want ... maybe change sed.sh like arr=(sed  sed  sed ) and then source sed.sh and then for b in ${arr[*]}?Anybody please know how to deal with this in an elegant way (e.g., reusable) manually ?My IFS try was rather cumbersome and didn't work anyway... $b became a single statement including the spaces and all and there were no such commandSAVEIFS=$IFSIFS=$(echo -en \n\b)sedie=\`grep -v -e '^#' ../../sed.sh\`for i in *do  for b in $sedie  do    echo cat $i \| $($b) \> ${i}.new    echo mv ${i}.new $i  donedoneIFS=$SAVEIFSwhich was not elegant at all.UPDATE #1Using this Q: extract file contents into array using bash scriptingand this one: How to execute command stored in a variable?, now I'm able to ..$ cat > myfile aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$ cat sed.sh sed -e 's/a/b/g'sed -e 's/b/c/g'sed -e 's/c/f/g'$ declare -a pole$ readarray pole < sed.sh$ for ((i=0;i<${#pole[@]};i++));do \    eval ${pole[i]} xfile > xfile.b; mv xfile.b xfile; done; $ cat xfilefffffffffffffffffffffffffffffffWhich is almost what I needed. So my question is basically two:how to read file into array?andhow to execute command in variable?
load bash comands from file one per line and execute them for each file in a directory
bash;shell script;sed;for