When I tested it, I happened to have only one *.sh file in that directory. Now I have two files and I get the same error as you do.
[glob *.sh] as such returns a list with two file names.
When I write these two file names in the exec command verbatim I don't get an error:
set MYLIST [exec ls -l ppc_timing.sh another.sh]
Now even when I do
set MYLIST [exec ls -l [join[glob *.sh]]]
and the outcome of [join[glob *.sh]] is exactly
ppc_timing.sh another.sh, ls returns an error.
set MYLIST [exec ls -l [lindex[glob *.sh] 0]]
but again returns only one file name.
You could use a foreach
loop as workaround. For the moment I have to stop looking as my boss starts looking at me.