Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


split command (splits a file)

Organization of this page

Format

split [-a suffix-length]
      [-b num-bytes [k|m]|-l num-lines] [input-path-name [prefix]]

Description

This command splits the contents of a file or of the standard input into segments and outputs the segments to separate files.

Arguments

-a suffix-length

Specifies the length of the suffix that is to be appended to the resulting file names after the input file is split.

Specify a value in the range 1 to 254. An error results if you specify a value outside this range (split: specified-value: too small or split: specified-value: too large) or you specify a non-numeric value (split: specified-value: invalid). The default is 2. If this option is specified multiple times, the last specification takes effect.

-b num-bytes [k|m]

Specifies in bytes the data size for each output file. If you specify both this option and the -l option, the command displays usage information and terminates.

  • k: Specifies that the specified value is in kilobytes (1k = 1,024 bytes).

  • m: Specifies that the specified value specified is in megabytes (1m = 1,048,576 bytes).

If this option is specified multiple times, the last specification takes effect.

-l num-lines

Specifies the number of lines for each output file. If you specify both this option and the -b option at the same time, the command displays usage information and terminates. If the -b and -l options are both omitted, the default value of 1000 (lines) is used.

input-path-name

Specifies the name of the input file. If this option is omitted, the standard input is read as the input.

prefix

Specifies a prefix for each file name after the split.

The file names of the output files after the split are constructed as follows:

prefix+suffix

If a prefix is specified, that character string is used. If no prefix is specified, x, y, and z are used in succession.

The suffix value is a character string consisting of lowercase alphabetic letters (a to z) of the length specified in suffix-length. Suffixes are created automatically, incrementing in alphabetical order.

For example, if the suffix length is set at two bytes, the suffix for the first file will be aa, and the successive files' suffixes will be ab, ac, ..., az, ba, bb, ....

Return codes

Return code

Meaning

0

Normal termination

1 or greater

Error termination

Notes

Usage examples