From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,4b8f47b6d4f87a21 X-Google-Attributes: gidfee84,public From: gurman@uvsp.gsfc.nasa.gov (Joseph B. Gurman) Subject: Re: Deleting files with odd names Date: 1995/10/05 Message-ID: #1/1 X-Deja-AN: 117087912 references: <44rk7q$bg2@lyra.csx.cam.ac.uk> organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA newsgroups: comp.unix.osf.osf1 In article <44rk7q$bg2@lyra.csx.cam.ac.uk>, Dave Hodgson wrote: > I have a bunch of files in a directory which were tranferred from a Macintosh. > > Somehow the files whose names contained slashes '/' transferred OK and they > appear, when using `ls`, as having a name with a slash in, e.g: > > % ls > name/with/slash/in/it > % ls -al > name/with/slash/in/it not found > total 6 > drwxrwxr-x 14 marvin 4096 Oct 3 15:49 . > drwxrwsr-x133 marvin 24576 Oct 3 16:13 .. > > The name is obviously incompatible with UNIX that uses a '/' to delimit > directory names in a path. > > But no matter how I try I can't delete that damn things, even when I try > `rm -rf` on the directory above... Dave - I guess people just aren't being brainwashed with first-grade Bourne any more (and probably a good thing). If you want to "quote" an escape character (.i.e., one the shell would rather do something else with), precede it with a knockdown (backslash: \) character: e.g. % rm name\/with\/slash\/in\/it This even works for spaces (another MacPossibility). rm -rf doesn't work because (of course, you say, regaining your unix tunnel vision) it assumes an argument of all _regular_ expressions in the pwd. I could refer you to a great chapter in the Unix Hater's Handbook on how braindead unix file name parsing is, but what's the point? Hope this helps, Joe Gurman -- Joseph B. Gurman / NASA Goddard Space Flight Center/ Solar Data Analysis Center / Code 682 / Greenbelt MD 20771 USA / gurman@uvsp.nascom.nasa.gov | Federal employees are still prohibited from holding opinions while at work. Any opinions expressed herein must therefore be someone else's. |