谁知道Unix下Mailx的用法?

忙里偷闲

新手上路
注册
2002-04-24
消息
2,527
荣誉分数
1
声望点数
0
我知道如何mail一个文件,但是谁知道如何mail一串字符?谢谢。
 
% mailx Your-login <-- This starts the process of
entering a message.
subject: <-- Subject line of messge, this is optional.
blah blah blah <-- Body of
this is a test. your message.
. <-- A single period ends your message.

EOT <-- End of Transmission signal.
%
 
不要人机对话,想用一行命令解决。举个例子吧。

送文件:
mailx -s subject address@xxx.com < file.txt

file.txt的内容:
111

问,如何用mailx直接用一行命令send这串字符。
 
哦,贱贱不知道啦。
不过如果不想要这个文件,用完了删了不行吗?
比如:mailx address@whatever.com < file | rm file
 
俺现在就在这么做,把字符串写入一个文件。发完后再删文件。
不过又遇上新问题。

perl:

$input="123\n456" ;
print OUT $input ;

结果打开文件一看只剩下"123"了,"\n456"无影无踪。是不是只能用循环写呀。
:crying:
 
贱贱不懂perl。:blowzy:
 
后退
顶部