here 字串
Version >= 2.05b 以上
你可以使用此處的字串來提供命令,如下所示:
$ awk '{print $2}' <<< "hello world - how are you?"
world
$ awk '{print $1}' <<< "hello how are you
> she is fine"
hello
she
你還可以使用 here 字串提供 while
迴圈:
$ while IFS=" " read -r word1 word2 rest
> do
> echo "$word1"
> done <<< "hello how are you - i am fine"
hello