| -safe |
|
| -portable | Performs the same cleanup operations as -safe, and
additionally:
|
| -lower -upper -title |
Converts the filenames to lower, UPPER, or Title Case. |
| -nospace | Maps all spaces to underscore. |
| -nodash | Maps all dashes (hyphens) to underscore. |
These options can be specified with the cop and rena commands, and are used to clean up filenames. They would typically be used with a wildcard input file specification.
None of these options are on by default, so these transformations
will not be
carried out unless you explicitly ask for them.
> rena '*.*' -lower -portableChanges all filenames in the directory to lower case, and converts national letters and characters that are likely to cause problems on some platforms.
> cop '*.*' '/export/*.*' -nospaceCopies files and makes sure that the output filenames do not contain any spaces or any of the most problematic characters.
Map leading "-" to underscore
Any leading dashes ("-") are mapped to underscore characters..
Filenames that start with a dash will cause problems for many Unix command line utilities.
Collapse spaces
Leading and trailing whitespace characters are removed, all
whitespace control charaters are mapped to an ordinary space, and
multiple whitespace characters are collapsed to a single space.
Depending on what other cleanup options are given, this space may or may not be mapped to an underscore.
Map problem characters to underscore
The characters *?:[]"<>|(){}, as well as all
control characters that are not whitespaces, are mapped to underscore.
The character map that is used for the -safe option looks like this:
'\000\001\002\003\004\005\006\a\010\t\n\v\f\r\016\017\020' -> '_'
'\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\177' -> '_'
'\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217' -> '_'
'\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237' -> '_'
'/:*?[]<>|(){}=' -> '_'
'\042' -> '_' // double quote
'\134' -> '_' // backslash
'\240' -> ' ' // non-breaking space
'\255' -> '-' // soft hyphen
If you specify either of the -nospace or -nodash
options, -safe is enabled by default. If you do not want this,
you can disable it again with -nosafe
The following character map is used:
'\000\001\002\003\004\005\006\a\010\t\n\v\f\r\016\017\020' -> '_'
'\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\177' -> '_'
'\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217' -> '_'
'\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237' -> '_'
'/:*?[]<>|(){}=' -> '_'
'\042' -> '_' // double quote
'\134' -> '_' // backslash
'\240' -> ' ' // non-breaking space
'\255' -> '-' // soft hyphen
'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß' ->
'AAAAAAACEEEEIIIIDNOOOOO_OUUUUYTs'
'àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' ->
'aaaaaaaceeeeiiiidnooooo_ouuuuyty'
'¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷' ->
'_cL_Y___ca__R___23_u___10_______'
'`' -> '_'
'\047' -> '_' // single quote
Note: Filenames that contain characters from the upper half of the 8-bit ASCII alphabet work as expected under Windows. Under Linux, however, they do not, as each character that is greater than 127 appears to have been mapped to two characters by the filesystem.
If you have files under Windows with national letters in the names, and plan to copy them to Linux, you should make the names portable before moving them.
The option -lower converts the filenames to lower case, and -upper converts them to upper case.
Both the English letters A-Z and national letters in the 8-bit Latin 1 (ISO-8859-1) alphabet are converted. The -lower option corresponds to the following character map:
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" ->
"abcdefghijklmnopqrstuvwxyz"
"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ" ->
"àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ"
The option -title converts to "Title Case", which means that the first letter in each word is in upper case, and all other letters are in lower case.
The definition of what constitutes a "word" is very
straight-forward: a word may consist of
letters (including the national ones) and digits, and all other
characters
count as delimiters.
Maps all space characters to underscores.
If you specify the -nospace
option, -safe is enabled by default. If you do not want this,
you can disable it again with -nosafe
The -safe option causes any leading,
trailing, or multiple spaces in the filename are collapsed first,
before the remaining spaces are mapped to underscores.
Maps all dashes ("-") to underscore. Both leading dashes
and dashes that appear inside the filename are mapped.
If you specify the -nodash option, -safe is enabled by default. If you do not want this, you can disable it again with -nosafe