The simple script below does not work when, rather than passing a single file name, I want to pass multiple files through expansion characters like *
#!/bin/bash
fgrep -c '$$$$' $1
If I give the command script.sh file.in the script works. If I give the command script.sh *.in it doesn't.
$1is not set to*.in; it's set to the first item that*.inexpands to.*.in, if no matching files exist. ;)