These are the first half of changes needed to pass the dd/bytes.sh tests:
- Add iseek and oseek options (additive with skip and seek options)
- Implement tests for the new flags, matching those from dd/bytes.sh
Implement distributing lines of a file in a round-robin manner to a
specified number of chunks. For example,
$ (seq 1 10 | split -n r/3) && head -v xa[abc]
==> xaa <==
1
4
7
10
==> xab <==
2
5
8
==> xac <==
3
6
9
Previously, given 'cp -P a b', where 'a' and 'b' were both symlinks, cp
would end up replacing the target of 'b'.
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Fix a bug where `timeout --preserve-status` was not correctly
preserving the status code of the child process if it timed out. When
that happens, the status code of the child process is considered to be
the signal number (in this case, `SIGTERM`). The exit status of
`timeout` is then 128 plus the numeric code associated with `SIGTERM`.
* Adds support for mount path prefix matching and input path
canonicalization
- Sorts mount paths in reverse lexicographical order
- Canonicalize all paths and clear invalid paths
- Checking of mount path prefix matches input path
Implement the `--line-bytes` option to `split`. In this mode, the
program tries to write as many lines of the input as possible to each
chunk of output without exceeding a specified byte limit. The new
`LineBytesChunkWriter` struct represents this functionality.
Implement the `--output` command-line argument, which allows
specifying an exact sequence of columns to display in the output
table. For example,
$ df --output=source,fstype | head -n3
Filesystem Type
udev devtmpfs
tmpfs tmpfs
(The spacing does not exactly match the spacing of GNU `df` yet.)
Fixes#3057.
Correct the column header printed by `df` when the `--block-size`
argument has a value that is a multiple of 1024. After this commit,
the header looks like "1K" or "4M" or "117G", etc., depending on the
particular value of the block size. For example:
$ df --block-size=1024 | head -n1
Filesystem 1K-blocks Used Available Use% Mounted on
$ df --block-size=2048 | head -n1
Filesystem 2K-blocks Used Available Use% Mounted on
$ df --block-size=3072 | head -n1
Filesystem 3K-blocks Used Available Use% Mounted on
$ df --block-size=4096 | head -n1
Filesystem 4K-blocks Used Available Use% Mounted on
Add support for the `--total` option to `df`, which displays the total
of each numeric column. For example,
$ df --total
Filesystem 1K-blocks Used Available Use% Mounted on
udev 3858016 0 3858016 0% /dev
...
/dev/loop14 63488 63488 0 100% /snap/core20/1361
total 258775268 98099712 148220200 40% -
Implement `-n l/k/N` option, where the `k`th chunk of the input file
is written to stdout. For example,
$ seq -w 0 99 > f; split -n l/3/10 f
20
21
22
23
24
25
26
27
28
29