BASH and wildcard expansion

Mark Haney mark.haney at gmail.com
Mon Aug 19 19:15:14 UTC 2013


Let me try again.  I want to copy a file with a filename like
2013-August-18--1123.zip to another folder.  However, because the last 4
digits of the filename won't always be the same, I want to be able to
search in a bash script for '2013-August-18--*.zip'. I.e. match all files
with '2013-August-18--' in the filename.  From a console I can do this by:

ls 2013-August-18--*.zip

How can I do that in a bash script.  I can probably use find, but this
seems much simpler and/or quicker than finding one file.

Does that make more sense?



On Mon, Aug 19, 2013 at 3:03 PM, Joe Zeff <joe at zeff.us> wrote:

> On 08/19/2013 11:56 AM, Mark Haney wrote:
>
>>
>> # Filename format YYYY_MM_DD--HHMM.zip
>> filename=$log_year"-"$log_**month"-"$log_day"--"/*".zip"
>>
>
> I think that's supposed to be "\*" but ICBW.
> --
> users mailing list
> users at lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.**org/mailman/listinfo/users<https://admin.fedoraproject.org/mailman/listinfo/users>
> Fedora Code of Conduct: http://fedoraproject.org/code-**of-conduct<http://fedoraproject.org/code-of-conduct>
> Guidelines: http://fedoraproject.org/wiki/**Mailing_list_guidelines<http://fedoraproject.org/wiki/Mailing_list_guidelines>
> Have a question? Ask away: http://ask.fedoraproject.org
>



-- 
Caesar si viveret, ad remum dareris.

Mark Haney
Software Developer/Consultant
mark.haney at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20130819/f1e6a2fb/attachment.html>


More information about the users mailing list