grep *.tpl is not working
Linux version: Slackware 11.0.0
grep -rl bar ./*tpl
grep: ./*tpl: No such file or directory
grep -rl bar ./*php
Why does it not work with extnesion tpl?
This is because there are no files with a tpl ending in the current directory. The * doesn't get expanded by grep, it gets expanded by the shell before grep ever sees it.
grep -rl barcode ./*php
grep -ril barcode *.tpl */*.tpl
grep: *.tpl: No such file or directory
But with grep -rl barcode ./*tpl
It does not return any file though there is file with string barcode "equipment_maintain_due_assaign_wo.tpl"
grep lists lines in file(s) that partially match a pattern. The -l option lists the file name that does include a line that matches the pattern. If one is trying to list filenames that have a pattern one needs to generate a a list of filenames to match against. Try:
$ ls *.tpl | grep barcode
In other words: grep searches in the selected files, not the filenames.
|All times are GMT -5. The time now is 05:41 PM.|