O'Reilly logo

Shell Scripting Recipes: A Problem-Solution Approach, Second Edition by Jayant Varma, Chris F. A. Johnson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 6

image

Loose Names Sink Scripts: Bringing Sanity to Filenames

The Naming of Files is a serious matter,

This isn’t just one of your Usenet flames;

You may think at first it doesn’t much matter

But I tell you, a file should have a SENSIBLE NAME.

(with apologies to T. S. Eliot)

What is a sensible name, and what can be done about pathological filenames? In this chapter, we describe alternatives for creating acceptable filenames and provide scripts for dealing with bad names. We also provide shell replacement functions for the basename and dirname commands.

What’s in a Name?

A Unix filename may contain any character except NUL and the forward ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required