I would like to put below check in a for loop but do not know how to put the variables as input list, just like $A,$B,$C
A="file name1.txt"
B="file name2.txt"
C="file name3.txt"
if [[ ! -f "$A" ]]; then
echo "file $A not exist"
fi
if [[ ! -f "$B" ]]; then
echo "file $B not exist"
fi
if [[ ! -f "$C" ]]; then
echo "file $C not exist"
fi
for f in file1 file2 file3; do if [[ ! -f $f ]]; then echo "file $f not exist"; fi; done-einstead.for file in "$A" "$B" "$C"; do if [[ ! -f "$file" ]]; then ..., but why would you make that extra work for yourself instead of using an array?