mirror / busybox

BusyBox mirror

Home Page:https://www.busybox.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

truncate: support for SIZE prefix

tjanas opened this issue · comments

~/Test $ truncate --help
BusyBox v1.37.0.git (2023-08-01 12:16:57 UTC)

Usage: truncate [-c] -s SIZE FILE...

Truncate FILEs to SIZE

        -c      Do not create files
        -s SIZE
~/Test $ truncate -s -64 testFile.bin
truncate: invalid number '-64'

From man pages:

SIZE may also be prefixed by one of the following modifying characters: ‘+’ extend by, ‘-’ reduce by, ‘<’ at most, ‘>’ at least, ‘/’ round down to multiple of, ‘%’ round up to multiple of.