Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] How to cope with strange filenames in bash?
- Date: Tue, 03 Jul 2007 11:20:42 +0300
- From: Tapio Peltonen <tappel@example.com>
- Subject: Re: [tlug] How to cope with strange filenames in bash?
- References: <20070703072842.GG3938@wasi.karlov.mff.cuni.cz> <d8fcc0800707030053h1a9f4c2dj95c59aaad32447fc@mail.gmail.com>
- User-agent: Mutt/1.5.13 (2006-08-11)
On Tue, Jul 03, 2007 at 04:53:06PM +0900, Josh Glover wrote: > On 03/07/07, Michal Hajek <hajek1@example.com> wrote: > > >a simple question: > > deserves a simple answer. ;) > > >how do I cope in bash with filenames containing "-" character (i.e. > >dash) ? > > ls -- <fn> This is the correct, and simplest answer. But there are ways to cope with filenames starting with "-" even without using "--". One way is to specify the path (.). $ echo -n > - $ ls -l -- - -rw-r--r-- 1 tappel tappel 0 Jul 3 11:12 - $ ls -l ./- -rw-r--r-- 1 tappel tappel 0 Jul 3 11:12 ./- Incidentally, you cannot create a file named "-" with touch without specifying the path. And specifying the path works with all those programs that do not honour "--". -- Tapio Peltonen <tappel@example.com>
- References:
- [tlug] How to cope with strange filenames in bash?
- From: Michal Hajek
- Re: [tlug] How to cope with strange filenames in bash?
- From: Josh Glover
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] [Announcement] TLUG Technical Meeting 2007-7-14
- Next by Date: [tlug] RE: Tlug Digest, Vol 19, Issue 11
- Previous by thread: Re: [tlug] How to cope with strange filenames in bash?
- Next by thread: Re: [tlug] How to cope with strange filenames in bash?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links