2011-12-06 47 views

回答

6

如何使用heredoc格式;

mail -s "$subject" [email protected] << MSG_BODY_HERE 
$line1 
$line2 
$line3 
$line4 
MSG_BODY_HERE 
-1
message="${line1}\n${line2}\n${line3}${line}\n" 
2

試試這個:

message="$(printf '%s\n' "$line1" "$line2" "$line3" "$line") 

echo "$message" | ... 
2

使用echo $ -e消息|郵件

從回聲手冊:

-e使反斜線的解釋轉義

相關問題