help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to read N bytes instead of N characters?


From: Peng Yu
Subject: How to read N bytes instead of N characters?
Date: Mon, 13 May 2024 12:34:04 -0500

Hi,

help read says this.
...
      -n nchars    return after reading NCHARS characters rather than waiting
            for a newline, but honor a delimiter if fewer than
            NCHARS characters are read before the delimiter
      -N nchars    return only after reading exactly NCHARS characters, unless
            EOF is encountered or read times out, ignoring any
            delimiter

Is there a way to read N bytes instead of N chars in bash? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]