st44985753
New Member
I'm new to Linux and would appreciate any help.
I have a bash script that includes the line below. By the time the script gets to this line, it's already working from the same directory as the .gz file.
/bin/gunzip -k < *.gz | /usr/bin/mysql -u root -p"************" sites
With the above, I keep getting a "file not found" error for the *.gz file. But when I change it to the full file name below, it works:
/bin/gunzip -k < backup_2021-01-16-0915_sitename_c1c565464574-db.gz | /usr/bin/mysql -u root -p"************" sites
I'd really like to use the wildcard so I don't have to edit the bash script with the latest file name every time I run it.
Any ideas why the wildcard isn't working?
Thanks!
I have a bash script that includes the line below. By the time the script gets to this line, it's already working from the same directory as the .gz file.
/bin/gunzip -k < *.gz | /usr/bin/mysql -u root -p"************" sites
With the above, I keep getting a "file not found" error for the *.gz file. But when I change it to the full file name below, it works:
/bin/gunzip -k < backup_2021-01-16-0915_sitename_c1c565464574-db.gz | /usr/bin/mysql -u root -p"************" sites
I'd really like to use the wildcard so I don't have to edit the bash script with the latest file name every time I run it.
Any ideas why the wildcard isn't working?
Thanks!