Date: Sun, 25 Aug 2002 09:17:32 -0700 From: Nathan Kinkade <nkinkade@dsl-only.net> To: Jimmy Lantz <jimmy.lantz@lusidor.com> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Problem accessing file no 2. Message-ID: <20020825091732.0c5707e9.nkinkade@dsl-only.net> In-Reply-To: <5.1.0.14.0.20020823172627.00bbeec8@mail.lusidor.com> References: <5.1.0.14.0.20020823132915.027a0008@mail.lusidor.nu> <5.1.0.14.0.20020823172627.00bbeec8@mail.lusidor.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 23 Aug 2002 17:52:11 +0200 Jimmy Lantz <jimmy.lantz@lusidor.com> wrote: > foobar# ls -alb > -rw-r----- 1 ftp ftp 464 19 Aug 14:27 un\214titled\034 > foobar# cp un^Ětitled^\ ->! After typing un i pressed tab and > this filename unveiled > wheras trying > foobar# cp un\214titled\034 un\214titled.txt > cp: un214titled034: No such file or directory > > well copying with the ? works but not with the desired preciseness > since I usually have files with very similiar names. > > Have you got any clues? > / Jimmy > At 14:55 2002-08-23 +0200, you wrote: > >From: "Jimmy Lantz" <jimmy.lantz@lusidor.com> > > > Hi, > > > I 'm wondering a bit on how to access files that starts > > > with a character not "supported" directly by freebsd, > > > i mean if the file starts with a char that got translated into ? > > > by > >freebsd, > > > how do I know which char to enter to access it ? > > > > > > -rw-r----- 1 ftp ftp 464 19 Aug 2003 ?estfile.txt > > > > > > It's not a a question mark it's just been substituted. > > > >I would try something like: > ># mv ?estfile.txt testfile.txt > > > >In this case the command you type is with a real '?' character, > >which, coincidentally, matches any character (it is a > >single-character wildcard, similar to *, but for one character > >only!). Hopefully you will end up with a file called 'testfile.txt'. > > > >BTW: ls -lb might reveal what the funny character actually is. This may not be the ideal solution, but it should work. Change to the directory where the file in question resides. Then try something like: $ for f in `ls un*titled*`; do cp $f $f.txt; done The idea is to dump the filename with odd characters into a shell variable and then simply tack on ".txt" to the end of the variable. This way you don't have to guess at the characters. You let bash figure out what to do. Maybe someone else knows a better way to dump the filename into a shell variable? Nathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020825091732.0c5707e9.nkinkade>