Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Feb 2003 23:00:55 +0200
From:      Willie Viljoen <will@unfoldings.net>
To:        Andres Aitsen <Andres.Aitsen@mail.ee>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to delete a file called ????
Message-ID:  <200302122300.55135.will@unfoldings.net>
In-Reply-To: <200302122254.47194.Andres.Aitsen@mail.ee>
References:  <20030212111232.A6759@skytrackercanada.com> <200302121145.33271.kstewart@owt.com> <200302122254.47194.Andres.Aitsen@mail.ee>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 12 February 2003 22:54, Andres Aitsen wrote:
> =DChel kenal p=E4eval (kolmap=E4ev, 12. veebruar 2003 21:45) kirjutas Ken=
t=20
Stewart:
> > On Wednesday 12 February 2003 11:21 am, parv wrote:
> > > > I have a file called ???????????????
> > > > I can't seem to clean it away.
> > > >
> > > > rm ????????
> > > > rm '????????'
> > > > rm "????????"
> > > >
> > > > all do not work.
> >
> > That is a lot of work when you could have just
> >
> > rm -- ???????????????
> >
> > The "--" tells rm that what follows is a file name.
>
> Well, simple test showed, what does the job.
>
> %touch \?\?\?\?\?\?\?\?\?\?\?\?\?\?\?
> %ls -l
> total 0
> -rw-r--r--  1 andres  wheel  0 Feb 12 22:50 ???????????????
> %rm \?\?\?\?\?\?\?\?\?\?\?\?\?\?\?
> %ls -l
> %
>
> Andres
>
> Andres.Aitsen@mail.ee
>

Or, if you are using csh:

%touch '?????'
%ls -lh '?????'
=2Drw-r--r--  1 will  will  0B Feb 12 22:58 ?????
%rm '?????'
%ls -lh '?????'
ls: ?????: No such file or directory
%

Note, single quotes ('), not double quotes (").

The reason for this is that shells will still inspect variables and wild=20
cards inside double quotes. Inside single quotes, you could even put a=20
double quote without having problems.

Will

>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

=2D-=20
Willie Viljoen
=46reelance IT Consultant

214 Paul Kruger Avenue, Universitas
Bloemfontein
9321
South Africa

+27 51 522 15 60
+27 51 522 44 36 (after hours)
+27 82 404 03 27 (mobile)

will@unfoldings.net

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?200302122300.55135.will>