why cant i expand filenames in bash
why cant i expand filenames in bash
(OP)
Hello,
why cant i get this to work in my bash script? I have multiple files with the same name but different file extension.
example
batch.prd
batch.uat
batch.dev
_filename="repo/batch"
seek=$(grep "job name_A" "$_filename*" |sort -u)
I've tried "$_filename.*" and "$_filename./*" but bash will not expand the filenames for the grep to do a once over and i prefer not writing a loop to go thru each file. Any thoughts as I'm just not sure how to expand a filename with extensions
Thanks in advance!
why cant i get this to work in my bash script? I have multiple files with the same name but different file extension.
example
batch.prd
batch.uat
batch.dev
_filename="repo/batch"
seek=$(grep "job name_A" "$_filename*" |sort -u)
I've tried "$_filename.*" and "$_filename./*" but bash will not expand the filenames for the grep to do a once over and i prefer not writing a loop to go thru each file. Any thoughts as I'm just not sure how to expand a filename with extensions
Thanks in advance!
RE: why cant i expand filenames in bash
So your asterisk ( * ) enclosed in double quotes ( " ) is considered a literal asterisk character, without any special meaning. So just do not enclose it in double quotes.
Feherke.
feherke.github.io
RE: why cant i expand filenames in bash