Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #16223
| From | worley@alum.mit.edu (Dale R. Worley) |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Proposed new feature for bash: unbuffered pipes, part 2: demo implementation |
| Date | 2020-04-21 20:39 -0400 |
| Message-ID | <mailman.919.1587515998.3066.bug-bash@gnu.org> (permalink) |
| References | <87imhswdyw.fsf@hobgoblin.ariadne.com> |
The baseline behavior is that this command, after 10 seconds, outputs 10 lines of output: $ bash -c 'for I in $( seq 10 ) ; do echo ABCDE ; sleep 1 ; done | grep A | cat' To build and run a demo of the "unbuffered pipes" feature: Create and cd to a scratch directory. Build a modified Bash: $ wget http://ftp.wayne.edu/gnu/bash/bash-5.0.tar.gz $ tar -xf bash-5.0.tar.gz $ pushd bash-5.0 $ patch -p1 <bash.diff # from the message in this series $ ./configure $ make $ export BASH=$( pwd )/bash $ ls -l $BASH $ popd Build a modified glibc: $ git clone git://sourceware.org/git/glibc.git $ pushd glibc $ git checkout release/2.31/master $ patch -p1 <glibc.diff # from the message in this series $ popd $ mkdir install $ mkdir glibc-build $ pushd glibc-build $ ../glibc/configure --prefix=$( pwd )/../install $ make $ export LIBC=$( pwd )/libc.a $ ls -l $LIBC $ popd Statically link a grep that uses this glibc: $ wget https://gnu.askapache.com/grep/grep-3.4.tar.xz $ tar -xf grep-3.4.tar.xz $ pushd grep-3.4 $ ./configure $ make $ # On Fedora 32, this is the command that "make" above used to create $ # the executable "grep", modified to statically link it with $LIBC. $ # I had to install the "pcre-static" and "glibc-static" packages to make $ # it work. $ pushd src $ gcc -static -g -O2 -o grep dfasearch.o grep.o kwsearch.o kwset.o searchutils.o pcresearch.o ../lib/libgreputils.a ../lib/libgreputils.a -lpcre -lpthread $LIBC $ export GREP=$( pwd )/grep $ ls -l $GREP $ file $GREP The desired behavior is that this command outputs one line of output each second for 10 seconds: $ $BASH -c 'for I in $( seq 10 ) ; do echo ABCDE ; sleep 1 ; done | $GREP A >|> cat'
Back to gnu.bash.bug | Previous | Next | Find similar
Proposed new feature for bash: unbuffered pipes, part 2: demo implementation worley@alum.mit.edu (Dale R. Worley) - 2020-04-21 20:39 -0400
csiph-web