#!/bin/bashecho -n "Enter you name:"read name
echo"Hello $name, welcome to my program."
#!/bin/bashread -p "Please enter your age: " age
days=$[$age * 365 ]echo"That makes you over $days days old!"
#!/bin/bashread -p "Enter your name:" first last
echo"Checking data for $last, $first"
#!/bin/bashread -p "Enter a number: "
factorial=1
for(( count=1; count<= $REPLY; count++))do
factorial=$[$factorial * $count]#等号两端不要有空格doneecho"The factorial of $REPLY is $factorial"
#!/bin/bashifread -t 5 -p "Please enter your name: " name #记得加-p参数, 直接在read命令行指定提示符thenecho"Hello $name, welcome to my script"elseecho"Sorry, too slow!"fi
#!/bin/bashread -n1 -p "Do you want to continue [Y/N]? " answer
case$answerin
Y | y)echoecho"fine, continue on...";;
N | n)echoecho"OK, goodbye"exit;;
esac
#!/bin/bashread -s -p "Enter your passwd: " pass #-s 参数使得read读入的字符隐藏echoecho"Is your passwd readlly $pass?"
#!/bin/bash
count=1
cattest|whileread line
doecho"Line $count: $line"
count=$[$count + 1 ]doneecho"Finished processing the file"