I’m a green hand in Shell. Please see my following code. How to make it working?
[root@localhost ~]# ls {*.txt,*.exe}
a.txt b.txt a.exe b.exe
[root@localhost ~]# filter={*.txt,*.exe}
[root@localhost ~]# echo $filter
{*.txt,*.exe}
[root@localhost ~]# ls $filter
ls: {*.txt,*.exe}: No such file or directory
[root@localhost ~]#
This should do the trick: