.\" .\" This file is part of the Detox package. .\" .\" Copyright (c) Doug Harple .\" .\" For the full copyright and license information, please view the LICENSE .\" file that was distributed with this source code. .\" .Dd March 31, 2024 .Dt INLINE-DETOX 1 .Os .Sh NAME .Nm inline-detox .Nd clean up filenames (stream-based) .Sh SYNOPSIS .Nm .Op Fl f Pa configfile .Op Fl s Ar sequence .Op Fl v .Nm .Op Fl f Pa configfile .Op Fl s Ar sequence .Op Fl v .Ar .Nm .Op Fl L .Op Fl f Pa configfile .Op Fl v .Nm .Op Fl h | -help .Nm .Op Fl V .Sh DESCRIPTION The .Nm utility generates new filenames to make them easier to work with under Linux and other Unix-like operating systems. It replaces characters that make it hard to type out a filename with dashes and underscores. It also provides transcoding-based filters, converting ISO-8859-1 or CP-1252 to UTF-8. An additional filter unescapes CGI-escaped filenames. .Pp .Nm reads filename(s) from the input stream and writes the updated filename(s) to the output stream. .Pp If a filename is passed on the command line, .Nm reads this file and processes each line before writing it to the output stream. .Pp Running .Cm detox .Fl -inline is identical to running .Nm . .Ss Sequences .Nm is driven by a configurable series of filters, called a sequence. Sequences are covered in more detail in .Xr detoxrc 5 and are discoverable with the .Fl L option. The default sequence will run the .Ar safe and .Ar wipeup filters. Other examples of pre-configured sequences are .Ar iso8859_1 and .Ar iso8859_1-legacy , which both provide transcoding to UTF-8, and then finish with the .Ar safe and .Ar wipeup filters. .Ss Options .Bl -tag -width Fl .It Fl f Pa configfile Use .Pa configfile instead of the default configuration files for loading translation sequences. No other config file will be parsed. .It Fl h , -help Display helpful information. .It Fl L List the currently available sequences. When paired with .Fl v this option shows what filters are used in each sequence and any properties applied to the filters. .It Fl s Ar sequence Use .Ar sequence instead of .Cm default . .It Fl v Be verbose about which files are being renamed. .It Fl V Show the current version of .Nm . .El .Sh FILES .Bl -tag -width Fl .It Pa /etc/detoxrc The system-wide detoxrc file. .It Pa ~/.detoxrc A user's personal detoxrc. Normally it extends the system-wide .Pa detoxrc , unless .Fl f has been specified, in which case, it is ignored. .It Pa /usr/share/detox/cp1252.tbl The provided CP-1252 transcoding table. .It Pa /usr/share/detox/iso8859_1.tbl The provided ISO-8859-1 transcoding table. .It Pa /usr/share/detox/safe.tbl The provided safe character translation table. .It Pa /usr/share/detox/unicode.tbl The provided Unicode control character filtering table, used by the UTF-8 filter. .El .Sh EXAMPLES .Bl -tag -width Fl .It echo "Foo Bar" | Nm Fl s Ar lower Fl v Will run the sequence .Ar lower , listing any changes and returning the result to the output stream. .El .Sh SEE ALSO .Xr detox 1 , .Xr detox.tbl 5 , .Xr detoxrc 5 , .Xr ascii 7 , .Xr iso_8859-1 7 , .Xr unicode 7 , .Xr utf-8 7 .Sh HISTORY .Nm was originally designed to clean up files that I had received from friends which had been created using other operating systems. It's trivial to create a filename with spaces, parenthesis, brackets, and ampersands under some operating systems. These have special meaning within .Fx and Linux, and cause problems when you go to access them. I created .Nm to clean up these files. .Pp Version 2.0 stepped back from transliteration out of the box, instead focusing on ease of use. Version 3.0 further shifted this, by removing most of the transliteration from the tables. The primary motivations for this were user-provided feedback, and the fact that many modern Unix-like OSs use UTF-8 as their primary character set. Transliterating from UTF-8 to ASCII in this scenario is lossy and pointless. .Sh AUTHORS .Nm was written by .An Doug Harple .