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

Re: Problem mit read (bash-builtin)



Hallo Heiko!

Heiko Schlittermann schrieb am Donnerstag, den 05. Juli 2012:

> Christian Brabandt <dug@256bit.org> (Do 05 Jul 2012 12:50:35 CEST):
> > Hallo Heiko!
> > 
> > Heiko Schlittermann schrieb am Mittwoch, den 04. Juli 2012:
> > 
> > > Martin Steigerwald <Martin@lichtvoll.de> (Mi 04 Jul 2012 20:42:25 CEST):
> > > > martin@merkaba:~> echo "hallo" | read x
> > > > martin@merkaba:~> echo $x
> > > > hallo
> > > 
> > > Ich meine mich zu erinnern, daß die Korn-Shell das letzte Kommando der
> > > Pipeline in der aktuellen Shell ausführt (die PDKsh macht das genauso
> > > wenig wie die Bash).
> > 
> > IIRC, kann das die bash auch. Ah, hier:
> > #v+
> > chrisbra@host:~$ unset x; echo "foobar" |read x; echo $x
> > bash: x ist nicht gesetzt.
> > chrisbra@host:~$ set +m && shopt -s lastpipe
> > chrisbra@host:~$ unset x; echo "foobar" |read x; echo $x
> > foobar
> > #v-
> 
> Welche Shell hast Du?
> 
>     GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)
>     Copyright (C) 2009 Free Software Foundation, Inc.
>     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> 
>     This is free software; you are free to change and redistribute it.
>     There is NO WARRANTY, to the extent permitted by law.
> 
> Diese kann das mit dem "lastpipe" nicht.

Ah ja, das ist bash 4.2 spezifisch:
#v+
chrisbra@host:~$ echo $BASH_VERSION
4.2.24(1)-release
#v-

Grüße
Christian


Reply to: