How to increment an integer while passing a multi-line string to a command using "Here tag" in bash
I have a piece of code that looks similar to this: index=SOME_INTEGER SOME_COMMAND <<EOF subcommand1 ${index} subsubcommand1 subcommand2 $((${index}+1)) subsubcommand2 subcommand3 $((${index}+2)) subsubcommand3 subcommand4 $((${index}+3)) subsubcommand4 subcommand5 $((${index}+4)) subsubcommand5 EOF This method of manually adding one more to ${index} for each new subcommand is quite tedious, and not very practical if i need to rearrange… Read More How to increment an integer while passing a multi-line string to a command using "Here tag" in bash