help-bash
[Top][All Lists]
Advanced

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

Re: How to read \000?


From: Greg Wooledge
Subject: Re: How to read \000?
Date: Wed, 15 May 2024 21:53:51 -0400

On Wed, May 15, 2024 at 08:27:37PM -0400, Jeffrey Walton wrote:
> On Wed, May 15, 2024 at 6:20 PM Greg Wooledge <greg@wooledge.org> wrote:
> 
> > On Wed, May 15, 2024 at 06:01:04PM -0400, Jeffrey Walton wrote:
> > > On Wed, May 15, 2024 at 3:48 PM Peng Yu <pengyu.ut@gmail.com> wrote:
> > >
> > > > No. I need to just read one character.
> > > >
> > >
> > > `tail -c +1` will read just one character.
> >
> > I think you have the wrong command.  Perhaps you meant "head -c 1"?
> >
> 
> No. head does not have a -c option, see <
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/head.html>.

Then it's a GNUism.  "tail -c +1" does not do what you wanted, and
"head -c 1" is non-portable.  That leaves dd, if portability is needed.



reply via email to

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