#!/bin/bash
MESSAGE="Line one. /n"
MESSAGE="$MESSAGE Line two. /n"
MESSAGE="$MESSAGE Line three."
echo $MESSAGE | mail -s "test" "example@example.com"
Run Code Online (Sandbox Code Playgroud)
这是我应该如何获得每条线,在它自己的线上?
Mat*_*hen 14
使用heredoc.
mail -s "test" "example@example.com" << END_MAIL
Line one.
Line two.
Line three.
END_MAIL
Run Code Online (Sandbox Code Playgroud)
更改:
echo $MESSAGE | mail -s "test" "example@example.com"
Run Code Online (Sandbox Code Playgroud)
至:
echo -e $MESSAGE | mail -s "test" "example@example.com"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26087 次 |
| 最近记录: |