简体   繁体   中英

sending colored output using linux mail/mailx

I'm using mailx to send colored output via email:

git diff | mailx -s "code diff output" usrname@srv.com

Output of git diff is colored but the received mail is plain.

You need to use

git diff --color=always | mailx -s "code diff output" usrname@srv.com

But when you read it will show asci character for color. So pipe to cat for reading:

mailx | cat

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM