Gestione input con read: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(No difference)
|
Latest revision as of 17:55, 29 June 2006
Per leggere una stringa da STDIN in bash, usare il comando read.
man bash / read \[
Esempio: Premere un tasto per continuare:
#!/bin/bash
read -n1 -p"Si o No ? " RISP
echo -e "\n"
if [[ ("$RISP" == "s" || "$RISP" == "S") ]]; then
echo Hai scelto Si
else
Hai scelto no o qualcosaltro
fi