command <<< string
command 是 Shell 命令,string 是字串(它只是一個普通的字串,並沒有什麼特別之處)。[[email protected] ~]$ tr a-z A-Z <<< one ONEHere String 對於這種傳送較短的資料到進程是非常方便的,它比 Here Document 更加簡潔。
[[email protected] ~]$ tr a-z A-Z <<< "one two three" ONE TWO THREE
[[email protected] ~]$ var=two [[email protected] ~]$ tr a-z A-Z <<<"one $var there" ONE TWO THERE [[email protected] ~]$ tr a-z A-Z <<<'one $var there' ONE $VAR THERE [[email protected] ~]$ tr a-z A-Z <<<one${var}there ONETWOTHERE
[[email protected] ~]$ tr a-z A-Z <<<"one two there > four five six > seven eight" ONE TWO THERE FOUR FIVE SIX SEVEN EIGHT