in reply to Re: Deleting an Odd Filename
in thread Deleting an Odd Filename

Or you can quote rm 'popdatck . $dept'

Replies are listed 'Best First'.
Re^3: Deleting an Odd Filename
by almut (Canon) on Jun 01, 2009 at 15:38 UTC

    That would be the most natural solution, IMHO (when using the shell).  Like Perl, most Unix shells interpolate variables ($dept) in double-quoted strings, while leaving them alone when single quotes are being used.

    The only case I'm aware of where this doesn't work (except when having single quotes in the name itself) is when you have a leading dash in the file name, like '-foo':

    $ rm '-foo' rm: invalid option -- o Try `rm ./-foo' to remove the file `-foo'. Try `rm --help' for more information.

    But, as you can see, rm is being helpful (at least some versions of it on Linux) by suggesting the workaround for this special case, i.e. rm ./-foo