Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #12244
| From | Stephane Chazelas <stephane.chazelas@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: read Built-in Parameter Behavior -- Null Byte Delimiter |
| Date | 2016-01-18 16:52 +0000 |
| Message-ID | <mailman.2534.1453154406.843.bug-bash@gnu.org> (permalink) |
| References | <CAOQZJ0GcG95QmPFKEUhhaxgUMiySdb6GnBuPDGPbb76tBAuC9A@mail.gmail.com> <20160118131456.GO27325@eeg.ccf.org> <569D0FC6.4010706@case.edu> <20160118162549.GQ27325@eeg.ccf.org> |
2016-01-18 11:25:49 -0500, Greg Wooledge: [...] > Other shells must go out of their way to suppress it, then. > > wooledg@wooledg:~$ while IFS= read -r -d '' foo; do echo "<$foo>"; done < <(printf 'one\0two\0') > <one> > <two> > wooledg@wooledg:~$ ksh > $ while IFS= read -r -d '' foo; do echo "<$foo>"; done < <(printf 'one\0two\0') > $ while IFS= read -r -d x foo; do echo "<$foo>"; done < <(printf 'onextwox') > <one> > <two> [...] zsh behaves like bash here (wrt to '', not in corner cases like: $ echo 'aéb' | bash -c "read -d $'\xc3' a; echo \$a" a $ echo 'aéb' | zsh -c "read -d $'\xc3' a; echo \$a" aéb ) Note that zsh supports passing NUL characters to its builtins, so read -d $'\0' var does do what it says on the tin there. ksh93's one seems to be broken with multi-byte characters: ~$ echo 'aéb' | ksh -c 'read -d é a; echo $a' aéb ~$ echo 'aéb' | ksh -c "read -d $'\xc3' a; echo \$a" zsh: done echo 'aéb' | zsh: segmentation fault ksh -c "read -d $'\xc3' a; echo $a" -- Stephane
Back to gnu.bash.bug | Previous | Next | Find similar
Re: read Built-in Parameter Behavior -- Null Byte Delimiter Stephane Chazelas <stephane.chazelas@gmail.com> - 2016-01-18 16:52 +0000
csiph-web