Björn Abheiden <[email protected]> (Di 11 Jan 2011 17:23:44 CET): > Hallo Heiko, > > Das schaut gut aus. Ja, ich wollte es für die Shell. > Du meintest sicherlich "while read REPLY; do". Da hatte ich mich erst > doch einen Moment drüber gewundert. Ich werde es später mal ausprobieren.
Nein, ich meinte „while read; do …“.
Es gibt einen kleinen subtilen Unterschied zwischen „read“ und „read NAME“.
read … [NAME ...]
The line is split into fields as with word splitting, and the first word
is assigned to the first NAME, the second word to the second NAME, and
so on, with any leftover words assigned to the last NAME.
…
If no NAMEs are supplied, the line read is stored in the REPLY variable.
echo " a b c " | { read REPLY; echo ".$REPLY."; }
echo " a b c " | { read ; echo ".$REPLY."; }
--
Heiko :: dresden : linux : SCHLITTERMANN.de
GPG Key 48D0359B : 3061 CFBF 2D88 F034 E8D2 7E92 EE4E AC98 48D0 359B
signature.asc
Description: Digital signature
_______________________________________________ Lug-dd maillist - [email protected] https://ssl.schlittermann.de/mailman/listinfo/lug-dd
