O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

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

Name

strfile

Synopsis

                  strfile [options] input_file [output_file]
unstr [-c 
                  delimiter] input_file[.ext] [output_file]

strfile creates a random-access file for storing strings. The input file should be a file containing groups of lines separated by a line containing a single percent sign (or other specified delimiter character). strfile creates an output file that contains a header structure and a table of file offsets for each group of lines, allowing random access of the strings. The output file, if not specified on the command line, is named sourcefile.dat. unstr undoes the work of strfile, printing out the strings contained in the input file in the order they are listed in the header file data. If no output file is specified, unstr prints to standard output; otherwise, it prints to the file specified. unstr can also globally change the delimiter character in a strings file.

Options

Of the following options, only -c can be used with unstr. All other options apply only to strfile.

-c delimiter

Change the delimiting character from the percent sign to delimiter. Valid for both strfile and unstr.

-i

Ignore case when ordering the strings.

-o

Order the strings alphabetically.

-r

Randomize access to the strings.

-s

Run silently; don’t give a summary message when finished.

-x

Set the STR_ROTATED bit in the header str_flags field.

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