info > ptx(1)

📛 NAME

ptx reads a text file and essentially produces a permuted index, with each keyword in its context. The calling sketch is either one of:

ptx [OPTION ...] [FILE ...]
ptx -G [OPTION ...] [INPUT [OUTPUT]]

The -G (or --traditional) option disables all GNU extensions and reverts to traditional mode, introducing some limitations and changing default option values.

🚀 Quick Reference

Use CaseCommandDescription
🧩 Generate a permuted index (GNU)ptx file.txtReads file.txt and outputs permuted index to stdout
🔄 Use traditional System V modeptx -G input.txt output.txtDisables GNU extensions; output written to file (destroys existing content)
📄 Process multiple input filesptx file1.txt file2.txtConcatenates files with contextual breaks
🔤 Ignore case for keyword sortingptx -f file.txtFold lower case letters to upper case for sorting
📝 Define break characters from fileptx -b breakfile file.txtCharacters in breakfile are NOT part of words
đŸšĢ Specify ignore file (words never keywords)ptx -i ignorefile file.txtWords in ignorefile are excluded from concordance
✅ Specify only file (only listed words)ptx -o onlyfile file.txtOnly words in onlyfile are retained as keywords
🔖 Use reference fields from input linesptx -r file.txtLeading non-whitespace sequence treated as line reference
📏 Set output line widthptx -w 80 file.txtSet maximum output width to 80 characters
📄 Output in roff formatptx -O file.txtGenerate output suitable for nroff/troff
📄 Output in TeX formatptx -T file.txtGenerate output suitable for TeX processing

📋 Menu

âš™ī¸ General options

-G / --traditional đŸšĢ Disables all GNU extensions to ptx and switches to traditional mode. --help ❓ Print a short help on standard output, then exit without further processing. --version â„šī¸ Print the program version on standard output, then exit without further processing.

✅ An exit status of zero indicates success, and a nonzero value indicates failure.

🔤 Charset selection

Currently, the program assumes the input file is coded using 8-bit ISO 8859-1 (Latin-1) unless compiled for MS-DOS (IBM-PC charset). This affects regular expression matching – the default keyword regex allows foreign/diacriticized letters. Keyword sorting obeys the underlying character set ordering.

-f / --ignore-case 🔠 Fold lower case letters to upper case for sorting.

📝 Word selection and input processing

-b FILE / --break-file=FILE 🔧 Alternative to -W for describing word constituents. FILE contains characters that cannot be part of a word (Break file). If both -b and -W are specified, -W takes precedence. When GNU extensions are enabled, newline is a break character unless omitted from the file entirely. When disabled, spaces, tabs and newlines are always break characters. -i FILE / --ignore-file=FILE đŸšĢ FILE contains words never taken as keywords (Ignore file). One word per line; line separation not affected by -S. -o FILE / --only-file=FILE ✅ FILE contains words retained in concordance output (Only file). Any word not in this file is ignored. One word per line. When both Only and Ignore files are specified, a word is a keyword only if listed in the Only file and not in the Ignore file. -r / --references 🔖 On each input line, the leading non-whitespace sequence is taken as a reference identifying the line. Changes default for -S. References are excluded from contexts when the context ends exactly at the newline (always true with -r and default -S or when GNU extensions disabled). -S REGEXP / --sentence-regexp=REGEXP đŸ”Ŧ Selects the regular expression describing end-of-line or end-of-sentence. Default (GNU enabled, no -r): end-of-sentence regex from GNU Emacs: [.?!][\]"')}]*\\($\\|\t\\| \\)[ \t\n]*. When GNU disabled or -r used: end-of-line regex \n. Empty REGEXP disables recognition entirely (whole file is one line/sentence). Many C backslash escape sequences are recognized. -W REGEXP / --word-regexp=REGEXP 🔤 Selects regex describing each keyword. Default (GNU enabled): \w+ (sequence of letters). Default (GNU disabled): [^ \t\n]+ (anything ending with space/tab/newline). Empty REGEXP equivalent to not using this option. C backslash escape sequences are recognized.

📄 Output formatting

Output format is mainly controlled by -O and -T. When neither selected and GNU extensions enabled, output is suitable for a dumb terminal: each keyword centered, surrounded by left/right contexts, properly justified. If automatic references (-A) are output before left context (no -R), a colon is added after the reference (works with Emacs next-error). White space becomes one space; other characters transmitted verbatim.

-g NUMBER / --gap-size=NUMBER 📏 Minimum white space gap between output fields. -w NUMBER / --width=NUMBER 📐 Maximum output width per line. If references are used, they are included/excluded depending on -R. Without -R, max width considers max reference length. With -R, references and preceding gap are not counted. -A / --auto-reference đŸˇī¸ Automatic references: each input line gets a reference of filename:line (empty filename for stdin). If both -A and -r are selected, the input reference is skipped and the automatic reference is used. -R / --right-side-refs 🔀 By default, references are placed to the far right. With -R, references are placed before the left context. Ignored for other output formats, except that with -R the width of references is not taken into account in total output width. Automatically selected when GNU extensions are disabled. -F STRING / --flag-truncation=STRING 🚩 Report truncation using STRING. Default: -F /. Empty STRING (-F "") disables truncation marking. C backslash escape sequences are recognized. -M STRING / --macro-name=STRING đŸˇī¸ Use STRING instead of xx in roff/TeX output formats. -O / --format=roff 📰 Output suitable for nroff/troff. Each line: .xx "TAIL" "BEFORE" "KEYWORD_AND_AFTER" "HEAD" "REF". Default when GNU extensions disabled. Non-graphical characters become one space; quotes doubled. -T / --format=tex 📐 Output suitable for TeX. Each line: \xx {TAIL}{BEFORE}{KEYWORD}{AFTER}{HEAD}{REF}. Special characters ($, %, &, #, _) are backslash-protected; curly braces with dollar signs; backslash becomes \backslash{}; diacritics produce appropriate TeX sequences. Non-graphical characters become one space.

🔄 The GNU extensions to 'ptx'

This version of ptx contains features not in System V ptx, suppressed by -G unless overridden. Some extensions cannot be recovered by overriding, so avoid -G if you care about GNU extensions. Differences:

ptx(1)
📛 NAME 🚀 Quick Reference 📋 Menu âš™ī¸ General options 🔤 Charset selection 📝 Word selection and input processing 📄 Output formatting 🔄 The GNU extensions to 'ptx'

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-03 16:10 @216.73.216.5
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^