Skip to main content
added 105 characters in body
Source Link
Lotney
  • 577
  • 1
  • 5
  • 9

How can the following be changed example so that it does glob expansion after loop variable substitution?

for i in a b c
    do echo $i/*.txt
done

UPDATE: This normally does work, however set -f had been done earlier in the script I'm looking at.

How can the following be changed example so that it does glob expansion after loop variable substitution?

for i in a b c
    do echo $i/*.txt
done

How can the following be changed example so that it does glob expansion after loop variable substitution?

for i in a b c
    do echo $i/*.txt
done

UPDATE: This normally does work, however set -f had been done earlier in the script I'm looking at.

Source Link
Lotney
  • 577
  • 1
  • 5
  • 9

Shell glob expansion after loop variable substitution

How can the following be changed example so that it does glob expansion after loop variable substitution?

for i in a b c
    do echo $i/*.txt
done