I have a problem with feeding cut output to ls.This doesn't work: rep=S1_1000,0000-00-00c,0000-00-00d,0000-00-00e  ls tab_yeast/{`echo $rep | cut -f2- -d','`}*.tab.gz  ls: cannot access tab_yeast/{0000-00-00c,0000-00-00d,0000-00-00e}*.tab.gz: No such file or directorywhile ls over that string works:ls tab_yeast/{0000-00-00c,0000-00-00d,0000-00-00e}*.tab.gz  Any idea?
ls for cut -f string not working
bash;ls;string;cut
I do not believe you can nest commands with brace expansions. It appears to only have the ability to contain literals. You should be able to utilize eval to get what you want though.Example$ a=1$ b=5$ echo {$a..$b}{1..5}If you eval the echo however:$ eval echo {$a..$b}1 2 3 4 5Your example$ ls -l tab_yeasttotal 0-rw-rw-r--. 1 saml saml 0 Feb 21 05:40 0000-00-00c.1.tab.gz-rw-rw-r--. 1 saml saml 0 Feb 21 05:40 0000-00-00d.1.tab.gz-rw-rw-r--. 1 saml saml 0 Feb 21 05:40 0000-00-00e.1.tab.gz-rw-rw-r--. 1 saml saml 0 Feb 21 05:40 S1_1000.1.tab.gzshow expanded$ eval echo tab_yeast/{`echo $rep | cut -f2- -d','`}*.tab.gz  tab_yeast/0000-00-00c.1.tab.gz tab_yeast/0000-00-00d.1.tab.gz tab_yeast/0000-00-00e.1.tab.gzyour modified command$ ls -1 $(eval echo tab_yeast/{`echo $rep | cut -f2- -d','`}*.tab.gz)tab_yeast/0000-00-00c.1.tab.gztab_yeast/0000-00-00d.1.tab.gztab_yeast/0000-00-00e.1.tab.gz