[英]Fill-in-the-Blank Shell Script
如何編寫 shell 腳本來提出問題,然后將答案存儲在變量中? 我在 OS X 中使用 bash。
基本上,這就是我想要做的:
What is your name? (prompt for a name) You entered: (and the name that the user entered)
怎么樣...
#!/bin/bash
/bin/echo -n "What is your name? "
read name
/bin/echo "You said $name"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.