I have a set of files like this:
A1.xlsx A2.xlsx B1.xlsx C1.xlsx C2.xlsx
I only know the prefixes (A, B, C) but the rest of the name is unknown beforehand, and so is the number of files. I need to call some commands passing them groups of those files like this:
mycommand A*.xlsx mv A*.xlsx tmp/ mycommand B*.xlsx mv B*.xlsx tmp/ mycommand C*.xlsx mv C*.xlsx tmp/
I've tried different syntaxes for the loop like
for fileGroup in A* B* C* but I've only managed to pass the filenames one by one to
mycommand, or instead to call
mycommand only once with all the files. Is there a syntax in bash to perform this?