Are wildcards ever supposed to be expanded for a program that is not the first in the pipeline? Every example uses wildcard for the first program in the pipelilne.
For example, the following does not work:
And if I do it like this, then it is grep and not the shell that expands the wildcard(?)
ls|grep -E "*.h"
Is there an example where the wildcard is not the first pipe? The reason I'm asking is that I'm implementing a shell and can do wildcards for the first program in the pipeline e.g.
ls *.h but I don't know if it should do it for subsequent pipes.
The background is that I'm writing my own shell and I've implemented wildcard:
$ ls *.c|grep mai  main.c $