Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Command touch and irregular file names

From: Mumia W.. <paduille.4061.mumia.w+nospam(at)earthlink.net>
Date: Wed Aug 15 2007 - 00:37:42 EDT


On 08/14/2007 07:54 PM, - Tong - wrote:
> Hi,
>
> How to let command touch to work with irregular file names?
>
> In my script I have
>
> touch -r "$file1" "$file2"
>
> the file1/2 can be anything file, ../path/file, /root/file, etc.
>
> The problem is when file1/2 are irregular file names. E.g., -test.file1/2.
>
> I.e., anyway to make the following touch command works?
>
> $ touch -r "-test.file1" "-test.file2"
> touch: invalid date format `est.file2'
>
> FYI, I tried this but didn't work:
>
> $ touch -r -- "-test.file1" "-test.file2"
> touch: invalid date format `est.file1'
>
> I think if the touch command uses the standard gnu getopt lib, then
> the above code should work, shouldn't it?
>
> Thanks
>
> tong
>
>

My touch command has the same problem as yours. I discovered this workaround:

file1="-test.file1"
file2="-test.file2"
ln -s -- $file1 ref

touch -r ref -- $file2
rm ref

I hope this helps.

If you think this is a bug, search for it in the bug tracking system, and if it's not there, you can report it.

I tested the Sarge version of 'touch.' The Etch version may be fixed. That's why it's good to look at the bugs list first--to avoid annoying our lovable Debian maintainers :-)

-- 
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Received on Wed Aug 15 01:02:28 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 02:11:42 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library