bug-bash
[Top][All Lists]
Advanced

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

Re: read command and ascii null as delimiter


From: Andreas Schwab
Subject: Re: read command and ascii null as delimiter
Date: Mon, 11 Sep 2006 17:39:54 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

"Nathan Coulter" <address@hidden> writes:

>>  read -d $'\0' will do most of what you want, with one limitation.  The
         ^^^^^^^^

This is actually equivalent to read -d ''.

> This doesn't seem be available in my version.  Is it a newer feature?
>
> $bash --version
> GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
> Copyright (C) 2002 Free Software Foundation, Inc.
>
> $printf 'hello\0there' | { read -d$'\0'; echo $REPLY ; }
                                  ^^^^^^^

This is equivalent to read -d.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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