Home | Mirror | Search |
cat <<End-of-message 8 ------------------------------------- 9 This is line 1 of the message. 10 This is line 2 of the message. 11 This is line 3 of the message. 12 This is line 4 of the message. 13 This is the last line of the message. 14 ------------------------------------- End-of-message
MYSQL=mysql MYSQLOPTS="-h $zs_host -u $zs_user -p$zs_pass $zs_db" $MYSQL $MYSQLOPTS <<SQL SELECT category.cat_id AS cat_id , category.cat_name AS cat_name , category.cat_desc AS cat_desc , category.parent_id AS parent_id , category.sort_order AS sort_order , category.measure_unit AS measure_unit , category.style AS style , category.is_show AS is_show , category.grade AS grade FROM category SQL
<<-LimitString可以抑制輸出時前邊的tab(不是空格). 這可以增加一個腳本的可讀性.
cat <<-ENDOFMESSAGE This is line 1 of the message. This is line 2 of the message. This is line 3 of the message. This is line 4 of the message. This is the last line of the message. ENDOFMESSAGE
關閉參數替換
NAME="John Doe" RESPONDENT="the author of this fine script" cat <<'Endofmessage' Hello, there, $NAME. Greetings to you, $NAME, from $RESPONDENT. Endofmessage
NAME="John Doe" RESPONDENT="the author of this fine script" cat <<\Endofmessage Hello, there, $NAME. Greetings to you, $NAME, from $RESPONDENT. Endofmessage
echo 1 > /proc/sys/net/ipv4/ip_forward echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward;