I have a question regarding how a variable can be called with another variable name inside a loop. The following script does not work:#!/bin/bash# Comparing test1.txt with test2.txt, test1.ini with test2.ini, test1.conf with test2.confFIRSTFILE1=test1.txt;SECONDFILE1=test2.txt;FIRSTFILE2=test1.ini;SECONDFILE2=test2.ini;FIRSTFILE3=test1.conf;SECONDFILE3=test2.conf;for NUM in {1..3};do  diff --brief <(sort $FIRSTFILE$NUM) <(sort $SECONDFILE$NUM) > /dev/null  value=$?  if [ $value -eq 1 ]  then    echo different  else    echo identical  fidone
Variable inside a variable in a loop
bash;variable
Not an explanation to the question if it is strictly about combining to variables into one but the following would give you a working result of iterating through your files:for EXT in txt ini conf;do  diff --brief <(sort test1.${EXT}) <(sort test2.${EXT}) > /dev/null  value=$?  if [ $value -eq 1 ]  then    echo different  else    echo identical  fidone