Very strange situation. check this out :
billy@prog:~/sql$ grep -R temp_exchange *.sp
billy@prog:~/sql$ grep -R temp_exchange *
events/sumup_events_by_exchange.sp:drop table if exists temp_exchange;
events/sumup_events_by_exchange.sp:create temporary table temp_exchange
so – the first grep returned nothing back, but the second grep did. therefore – the first grep should have returned something back as the sought after string was in a file ending with .sp (specified in the first command).
so I’d rather not parametrize this command with * as that seems a bad habit to get into.
Any other way I can do what I want without * ?
TIA!
Don
The last argument (in this case *) tells grep which files and directories to search.
This will cause grep to search a list of files consisting of all top level files that match the pattern, plus (in recursive mode) ALL files inside the directories.
Within these directories you can specify particular file patterns using the –include option.
From http://ss64.com/bash/grep.html