5
echo *.c

in bash, treats the argument as a constant and prints *.c. How to force it to consider it as a glob pattern and print the list of files/folders ending with .c?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
  • 3
    Your current directory doesn't contain any files/directory ending with `.c`, so `bash` left the pattern unchanged to `echo`. You can set `shopt -s failglob` to report error if pattern didn't match. – cuonglm Mar 23 '15 at 02:57

1 Answers1

5

Either you have nothing in your current directory that match your globbing pattern (then the pattern will stay as it is), or you have disabled globbing by shell option -f (or set -o noglob).

Janis
  • 14,014
  • 3
  • 25
  • 42