0
for executablefile in ./*.out; do executablefile; done

It should be self-explanatory from the title what I am trying to do in bash. Unfortunately, none of the tutorials online comes close to this. Can you post a working example and explain your changes?

Cyrus
  • 84,225
  • 14
  • 89
  • 153
shuhalo
  • 5,732
  • 12
  • 43
  • 60

1 Answers1

0

Have you tried using the proper variable syntax?

for executablefile in ./*.out; do "$executablefile"; done
Poshi
  • 5,332
  • 3
  • 15
  • 32
  • Properly speaking you should use double quotes around the variable interpolation, in case the wildcard matches anything which contains shell metacharacters. See also https://stackoverflow.com/questions/10067266/when-to-wrap-quotes-around-a-shell-variable – tripleee Sep 05 '18 at 07:02
  • Of course not; then I'd have posted a separate answer instead. – tripleee Sep 05 '18 at 07:04