Re: BASH and wildcard expansion

2013-08-20 Thread g
hello reberto, On 08/20/2013 08:33 AM, Roberto Ragusa wrote: On 08/19/2013 08:56 PM, Mark Haney wrote: I've hit a problem I can't quite figure out which a bash script I'm writing. I'm trying to copy backup files in the format 2013-August-18--1123.zip to an NFS share. I want to have the scr

Re: BASH and wildcard expansion

2013-08-20 Thread Bill Oliver
On Tue, 20 Aug 2013, Suvayu Ali wrote: My fault, I should have been more verbose. [snip] Excellent tutorial and explanation! Thanks. billo -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/us

Re: BASH and wildcard expansion

2013-08-20 Thread Roberto Ragusa
On 08/19/2013 08:56 PM, Mark Haney wrote: > I've hit a problem I can't quite figure out which a bash script I'm writing. > I'm trying to copy backup files in the format 2013-August-18--1123.zip to an > NFS share. I want to have the script copy the file with just the date. In > bash I've setup

Re: BASH and wildcard expansion

2013-08-20 Thread Mark Haney
That's what I missed. I used the wrong single quotes ' instead of `. Git. Should've caught that right off. It's been a while since I had a chance to script anything in bash, since I've worked mostly in Windows the last year or so and I'm rusty. Thanks. On Aug 19, 2013 6:18 PM, "Bill Oliver" wrote:

Re: BASH and wildcard expansion

2013-08-20 Thread g
hello mark, On 08/19/2013 01:56 PM, Mark Haney wrote: I've hit a problem I can't quite figure out which a bash script I'm writing. I'm trying to copy backup files in the format 2013-August-18--1123.zip to an NFS share. I want to have the script copy the file with just the date. In bash I've

Re: BASH and wildcard expansion

2013-08-20 Thread Suvayu Ali
Hi Bill, On Mon, Aug 19, 2013 at 07:56:03PM -0500, Bill Oliver wrote: > On Tue, 20 Aug 2013, Suvayu Ali wrote: > > >On Mon, Aug 19, 2013 at 05:18:40PM -0500, Bill Oliver wrote: > >> > >># Filename format _MM_DD--HHMM.zip > >>filename="$log_year-$log_month-$log_day--*.zip" > >> > >>filelist=`l

Re: BASH and wildcard expansion

2013-08-19 Thread Bill Oliver
On Tue, 20 Aug 2013, Suvayu Ali wrote: On Mon, Aug 19, 2013 at 05:18:40PM -0500, Bill Oliver wrote: # Filename format _MM_DD--HHMM.zip filename="$log_year-$log_month-$log_day--*.zip" filelist=`ls $filename` Please don't do this. A much better solution is: filelist=($log_year-$log_mont

Re: BASH and wildcard expansion

2013-08-19 Thread Suvayu Ali
On Mon, Aug 19, 2013 at 05:18:40PM -0500, Bill Oliver wrote: > > # Filename format _MM_DD--HHMM.zip > filename="$log_year-$log_month-$log_day--*.zip" > > filelist=`ls $filename` Please don't do this. A much better solution is: filelist=($log_year-$log_month-$log_day--*.zip) See:

Re: BASH and wildcard expansion

2013-08-19 Thread Bill Oliver
On Mon, 19 Aug 2013, Mark Haney wrote: I've hit a problem I can't quite figure out which a bash script I'm writing.   I'm trying to copy backup files in the format 2013-August-18--1123.zip to an NFS share.  I want to have the script copy the file with just the date.  In bash I've setup vars th

Re: BASH and wildcard expansion

2013-08-19 Thread Cameron Simpson
On 19Aug2013 15:15, Mark Haney wrote: | 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--*.

Re: BASH and wildcard expansion

2013-08-19 Thread Joe Zeff
On 08/19/2013 12:51 PM, Mark Haney wrote: I can (and am) using the date command in a variable. But, the filename is not just backup-08-18-2013.zip, which isn't a problem to do. The problem is the filename is variable /outside/ the date. For example: backup-08-18-2013--1215.zip. I can VAR the

Re: BASH and wildcard expansion

2013-08-19 Thread Mark Haney
I can (and am) using the date command in a variable. But, the filename is not just backup-08-18-2013.zip, which isn't a problem to do. The problem is the filename is variable /outside/ the date. For example: backup-08-18-2013--1215.zip. I can VAR the date parts, but that '1215' part I need to w

Re: BASH and wildcard expansion

2013-08-19 Thread Joe Zeff
On 08/19/2013 12:15 PM, Mark Haney wrote: 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. Are you looking for files with today's date, or with a specific date? In the former case, you can use the date command to pu

Re: BASH and wildcard expansion

2013-08-19 Thread Mark Haney
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

Re: BASH and wildcard expansion

2013-08-19 Thread inode0
On Mon, Aug 19, 2013 at 1:56 PM, Mark Haney wrote: > I've hit a problem I can't quite figure out which a bash script I'm writing. > I'm trying to copy backup files in the format 2013-August-18--1123.zip to an > NFS share. I want to have the script copy the file with just the date. In > bash I've

Re: BASH and wildcard expansion

2013-08-19 Thread Joe Zeff
On 08/19/2013 11:56 AM, Mark Haney wrote: # Filename format _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@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.

Re: BASH and wildcard expansion

2013-08-19 Thread Steve Searle
Around 07:56pm on Monday, August 19, 2013 (UK time), Mark Haney scrawled: > I've hit a problem I can't quite figure out which a bash script I'm > writing. I'm trying to copy backup files in the format > 2013-August-18--1123.zip to an NFS share. I want to have the script copy > the file with just

BASH and wildcard expansion

2013-08-19 Thread Mark Haney
I've hit a problem I can't quite figure out which a bash script I'm writing. I'm trying to copy backup files in the format 2013-August-18--1123.zip to an NFS share. I want to have the script copy the file with just the date. In bash I've setup vars that get the current date: # Date variables lo