[root@srv1 ~]# st=$(ls | tail -1) && scp $st root@localhost:/tmp && echo "файл скопирован" | sendmail root@localhost
test.sh 100% 100 0.1KB/s 00:00
You have mail in /var/spool/mail/root
[root@srv1 ~]# cat /var//spool/mail/root | tail
X-Original-To: root@localhost
Delivered-To: root@localhost.localdomain
Received: by srv1.localdomain (Postfix, from userid 0)
id B4C0E3FFE96; Mon, 19 Dec 2016 17:33:53 +0600 (ALM)
Message-Id: <20161219113353.B4C0E3FFE96@srv1.localdomain>
Date: Mon, 19 Dec 2016 17:33:53 +0600 (ALM)
From: root@srv1.localdomain (root)
файл скопирован