Bash here docs<< - 跳过领先的空白

时间:2013-03-21 02:11:03

标签: bash

我可以这样做:

declare foo -r -d '' <<- 'EOF'
->-> Sopra la panca
->-> la capra campa
EOF

(其中->表示TAB)

然后将忽略前导标签。

<<-可以用来跳过/忽略前导space,而不仅仅是tab s?

1 个答案:

答案 0 :(得分:0)

引用 from Greg

In this form, all leading tab characters (not spaces!) will be removed. There is 
no provision for removing leading spaces, or leading tabs-and-spaces. (Recall the
syntactic restrictions of Makefiles, and you'll be OK.)