[H-GEN] Shell usage...

Daehenoc n1455885 at student.fit.qut.edu.au
Mon Aug 24 20:30:32 EDT 1998


On Sun, 23 Aug 1998, Craig Eldershaw wrote:

> >> Hello everybody - i've screwed up whilst using ftp and created a file that
> >> starts with a '-' symbol - how do you kill this file in the shell?
> >
> >I've found for strange filenames, you can usually put quotes around
> >them, or just starting typing it and hitting tab (assuming bash) should
> >finish it and put quotes around it for you.
> 
> That will work if you have spaces or semicolons etc that might confuse
> the shell (eg 'rm father&son' would be parsed as two commands ('rm
> father' and 'son')).  But in this case the shell is not confused, the
> option `-' is in fact a single parameter which is being passed to the rm
> program.  The problem arises because rm itself is interpreting anything
> starting with a - as an option when it was meant to be a file.  So
> quoting won't help here.  Either removing the leading - by pre-prending
> a ./ or explicitely telling rm that there are not more options for it
> (and that all the rest are file names) by adding the -- are the way to go
> (as was pointed out previously).

Cool - thanks for the help everybody!

Greg Vickers,
PC technician experienced in:
Research and Development, Quality Assurance and On-site/In-house Service

... Daehenoc ... a.k.a The Gingerbread Man





More information about the General mailing list