Unix Review > Archives > 2007 > June 2007

UnixReview.com
June 2007

Shell Corner: Littera Delenda Est (Part Two)

Hosted by Ed Schaefer

In part 2 of his healing process, Royce Williams continues his unrelenting assault on files containing "funny characters".

Littera Delenda Est: On the Removal of Files with Unusual Characters in Their Filenames, Part Two

by Royce Williams

In last month's column, we learned that unusual characters in filenames fall into some discrete categories and started to tackle the hypothetical example of a directory full of them. The techniques already covered include escaping, workarounds for special shell characters, and dramatic overuse of battle metaphors. We continue in similar fashion, attacking the remaining character types in rough order of increasing difficulty.

Falling Back to Regroup

After our first round of skirmishes, let's see what work remains to delete these unusual files.

We also take this opportunity to remove those files that have already served their purpose as obstacles (so that we can better see what it is that we're having trouble seeing). Drawing on what we've learned so far, here is how to perform that removal, followed by a list of the survivors:

admin@unixlike$ rm -- -keeper \!keeper 0 A Z a z \~keep-me-too
admin@unixlike$ /bin/ls -lA
-rw-r-----  1 admin  admin  22 May  5  2006 ?
-rw-r-----  1 admin  admin  27 May  5  2006 ?
-rw-r-----  1 admin  admin  20 May  5  2006 ?
-rw-r-----  1 admin  admin  26 May  5  2006 ?
-rw-r-----  1 admin  admin  32 May  5  2006 ?
-rw-r-----  1 admin  admin  23 May  5  2006
-rw-r-----  1 admin  admin  29 May  5  2006  ? 
-rw-r-----  1 admin  admin  29 May  5  2006  
-rw-r-----  1 admin  admin  21 May  5  2006 ?

Up to this point, we've been going after what we might call the "low-hanging fruit": Those characters that have been easy to identify.

Sys Admin Spotlight

CMP DevNet Spotlight

Global Web Site Performance Improvement
Jeffrey Fulmer explains how to get a comprehensive picture of your site's performance and describes some tips for improving it.

In the News

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 11.0

Version 11.0 delivers every issue of Sys Admin from 1992 through 2005 and every issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!




MarketPlace

Workflow Enabled Help Desk & IT Service Management
Automate service desk activities and integrate processes across IT. Learn more here.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Discover WinDev 11 RAD
and develop 10 times faster ! ALM, IDE, .Net, PDF, 5GL, Database, 64-bit, etc. Free Express version

Online Crash Analysis
Automatically capture customer crash data, no debugger required. Support for .NET, C++, OS X, Java.

Wanna see your ad here?