reading input to shell

wuxidba發表於2011-06-12
!/bin/bash

echo "Please type a word!"
read word

echo "You just typed $word"

echo "Please type two words!"
read word1 word2

echo "You just typed $word1 $word2"

[jerry@localhost bin]$ ./reply_test.sh
./reply_test.sh: line 1: !/bin/bash: No such file or directory
Please type a word!
word
You just typed word
Please type two words!
word1 word2
You just typed word1 word2


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23895263/viewspace-697718/,如需轉載,請註明出處,否則將追究法律責任。

相關文章