bash read a if

Jan Kasprzak kas na fi.muni.cz
Čtvrtek Březen 24 10:44:06 CET 2005


arpanet wrote:
: #-------------------------------------------------------------------------
:  read REP
:  
:  if [ "$REP" == "a" ] || [ "$REP" == "A" ]; then
:      echo $REP
:  fi

	Selze pokud vlozim "-f". Ale jinak ano, je cistsi pouzit
"read promenna" nez proste "read" a pak nekde ocekavat, ze magicky
vznikne promenna "$REPLY".

: nebo treba
:  REP=""
:  read 
:  REP=$REPLY

Selze pokud vlozim "a b"

-Y.

-- 
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/   Czech Linux Homepage: http://www.linux.cz/ |
> Whatever the Java applications and desktop dances may lead to, Unix will <
> still be pushing the packets around for a quite a while.      --Rob Pike <


Další informace o konferenci Linux