作者scitamehtam (scitamehtam)
看板Linux
標題[問題] read cmd 超乎預期求原因
時間Wed Dec 22 12:08:48 2021
1.
在當前目錄下建立檔案
abs
2.
read
input:[abc]
echo $REPLY
顯示:a
3.
read
input: [cba]bs
echo $REPLY
顯示:abs
4.
read
input: [k]bs
echo $REPLY
顯示:[k]bs
5.
read
input: [cba]bs
echo “$REPLY”
顯示: [cba]bs
感覺跟該目錄下檔名有關耶?!
有人知道原因嗎?
感謝
----
Sent from
BePTT on my iPhone 12
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.216.43.48 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1640146130.A.68A.html
→ soem: 問題在變數的使用上 12/23 03:52
→ scitamehtam: thank first floor 12/23 12:15
推 Gold740716: echo "$REPLY" 01/03 14:45