Skip to main content
added 4 characters in body
Source Link
TNT
  • 3.5k
  • 1
  • 25
  • 28

Not exactly an answer to the quoting/escaping problem of the original question but probably something that would actually have been more useful for the op:

unset FILES
for f in 2011-*.jpg; do FILES+=($f"$f"); done
echo $"${FILES[@]}"

Where of course the expression would have to be adopted to the specific requirement (e.g. *.jpg for all or 2001-09-11-*11*.jpg for only the pictures of a certain day).

Not exactly an answer to the quoting/escaping problem of the original question but probably something that would actually have been more useful for the op:

unset FILES
for f in 2011-*.jpg; do FILES+=($f); done
echo ${FILES[@]}

Where of course the expression would have to be adopted to the specific requirement (e.g. *.jpg for all or 2001-09-11-*.jpg for only the pictures of a certain day).

Not exactly an answer to the quoting/escaping problem of the original question but probably something that would actually have been more useful for the op:

unset FILES
for f in 2011-*.jpg; do FILES+=("$f"); done
echo "${FILES[@]}"

Where of course the expression would have to be adopted to the specific requirement (e.g. *.jpg for all or 2001-09-11*.jpg for only the pictures of a certain day).

added 8 characters in body
Source Link
TNT
  • 3.5k
  • 1
  • 25
  • 28

Not exactly an answer to the escapingquoting/escaping problem of the original question but probably something that would actually have been more useful for the op:

unset FILES
for f in 2011-*.jpg; do FILES+=($f); done
echo ${FILES[@]}

Where of course the expression would have to be adopted to the specific requirement (e.g. *.jpg for all or 2001-09-11-*.jpg for only the pictures of a certain day).

Not exactly an answer to the escaping problem of the original question but probably something that would actually have been more useful for the op:

unset FILES
for f in 2011-*.jpg; do FILES+=($f); done
echo ${FILES[@]}

Where of course the expression would have to be adopted to the specific requirement (e.g. *.jpg for all or 2001-09-11-*.jpg for only the pictures of a certain day).

Not exactly an answer to the quoting/escaping problem of the original question but probably something that would actually have been more useful for the op:

unset FILES
for f in 2011-*.jpg; do FILES+=($f); done
echo ${FILES[@]}

Where of course the expression would have to be adopted to the specific requirement (e.g. *.jpg for all or 2001-09-11-*.jpg for only the pictures of a certain day).

Source Link
TNT
  • 3.5k
  • 1
  • 25
  • 28

Not exactly an answer to the escaping problem of the original question but probably something that would actually have been more useful for the op:

unset FILES
for f in 2011-*.jpg; do FILES+=($f); done
echo ${FILES[@]}

Where of course the expression would have to be adopted to the specific requirement (e.g. *.jpg for all or 2001-09-11-*.jpg for only the pictures of a certain day).