[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: I think I found a bug in the mv command
From: |
Jim Meyering |
Subject: |
Re: I think I found a bug in the mv command |
Date: |
Fri, 04 Feb 2005 19:29:05 +0100 |
Ian MacGregor <address@hidden> wrote:
> I think I found a bug in the mv command.
...
> When I change line #9 in the bash script from
> mv /home/storage/backup.tar.gz /home/storage/`date +%Y%m%d-%k%M`-backup.tar.gz
> to
> mv /home/storage/backup.tar.gz /home/storage/`date +%Y%m%d-%I%M`-backup.tar.gz
> the command runs fine and the only output is below, and as a cronjob, it runs
Thanks for the report, but that's not a bug in mv. Your date
command is printing a space in the expansion of %k when the
hour is a single digit number. That space makes it so `mv'
sees three arguments, and provokes the diagnostic you reported.
$ date --date='2005-02-04 02:00' +%Y%m%d-%k%M
20050204- 200
Use a format like %H that has zero-filled numbers.
$ date --date='2005-02-04 02:00' +%Y%m%d-%H%M
20050204-0200