STRFILE(8)
π STRFILE β bestie edition π
okay so this is the system manager's manual page for strfile(8), and honestly? it's giving βtiny utility, big main character energyβ π
. we're gonna keep every detail, no cap.
β¨ NAME β¨
strfile, unstr β create a random access file for storing strings π¦
π¦ SYNOPSIS π¦
strfile [-iorsx] [-c char] source_file [output_file]
unstr source_file
π DESCRIPTION π
okay so strfile reads a file containing groups of lines separated by a line containing a single percent % sign, and creates a data file. that data file contains a header structure plus a table of file offsets for each group of lines. the whole point? random access of the strings, periodt β¨.
The output file, if not specified on the command line, is named source_file.dat.
π the options π
the options are as follows, bestie β collect them all:
-cchar β change the delimiting character from the percent sign to char.-iβ ignore case when ordering the strings.-oβ order the strings in alphabetical order. the offset table will be sorted in the alphabetical order of the groups of lines referenced. any initial non-alphanumeric characters are ignored. this option causes theSTR_ORDEREDbit in the headerstr_flagsfield to be set.-rβ randomize access to the strings. entries in the offset table will be randomly ordered. this option causes theSTR_RANDOMbit in the headerstr_flagsfield to be set.-sβ run silently; don't give a summary message when finished.-xβ note that each alphabetic character in the groups of lines is rotated 13 positions in a simple caesar cypher. this option causes theSTR_ROTATEDbit in the headerstr_flagsfield to be set.
πΈ header format πΈ
the format of the header is literally this, bestie:
#define VERSION 2
u_int32_t str_version; /* version number */
u_int32_t str_numstr; /* # of strings in the file */
u_int32_t str_longlen; /* length of longest string */
u_int32_t str_shortlen; /* length of shortest string */
#define STR_RANDOM 0x1 /* randomized pointers */
#define STR_ORDERED 0x2 /* ordered pointers */
#define STR_ROTATED 0x4 /* rot-13'd text */
u_int32_t str_flags; /* bit field for flags */
u_int8_t str_delim; /* delimiting character */
u_int8_t str_pad[3]; /* padding */
All fields are written in network byte order. Each field is also written independently so as to avoid structure padding problems on some architectures. π«Ά
π¦ unstr, bestie π¦
The purpose of unstr is to undo the work of strfile. It prints out the strings contained in the file source_file in the order that they are listed in the header file source_file.dat to standard output. It is possible to create sorted versions of input files by using -o when strfile is run and then using unstr to dump them out in the table order.
π FILES π
source_file.datβ default output file.
π SEE ALSO π
π HISTORY π
The strfile utility first appeared in 4.4BSD.
okay bye bestie π this page came from Debian, dated August 14, 2013, and it's the STRFILE(8) manual page. slay responsibly β¨π«Ά
π¦ where this page comes from
- alpine 3.24: fortune-doc 0.1-r5 Β· BSD-3-Clause
- Copyright (c) 1989, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms