- echo "one two three" | tr a-z A-Z
- tr a-z A-Z <<< 'one two three'
- tr a-z A-Z <<< "one two three"
- tr a-z A-Z <<< 'one two three' > aFile
- tr a-z A-Z <<< 'one two three' >> aFile
Here string可以視為pipe | 的另外一種寫法,從後方輸入
使用here string搭配read可以一行指定多個變數:
- read a b c <<< 'one two three'
- echo $c $b $a
three two one
指令read的使用可以參考這篇 Bash讀檔案一次讀一行
_EOF_
沒有留言:
張貼留言