On Wed, Oct 29, 2008 at 12:01:05AM +0100, Henk Langeveld wrote: > > How do I get variable a to contain the expanded list of files, rather > > than the glob itself? > > Hi Jenny, this should do what you want: > > $ b=$(print $a) > $ echo "$b" > foo1 foo2 foo3 > $
Also: % set -A b -- $a % print -- "$...@]}" foo1 foo2 foo3 % Here 'b' is an array variable, which may not be what you want. Also: % OIFS=$IFS % IFS= % set -A b -- $a % IFS=$OIFS % print -- "${b[0]}" foo1 foo2 foo3 % And there are other ways: % function assign_all { > typeset -n var=$1 > var="$*" > } % assign b $a % print -- $b foo1 foo2 foo3 % ... Nico --