I can create some files in my dir using template:
touch file{1..3}
For get list of files I use command:
ls file{1..3}
Output:
file1 file2 file3
But when I have tried to use same command with variables in bash script:
#/bin/bash
a=1
b=3
ls file{$a..$b}
I got error:
ls: cannot access 'file{1..3}': No such file or directory
How I understand problem is that bash interprets file{1..3}
as name of file, but not as template.
I have tried to fix it but didn't help.
Any help would be appreciated.