self-mailer.sh
来自「Shall高级编程」· Shell 代码 · 共 29 行
SH
29 行
#!/bin/sh# self-mailer.sh: Self-mailing scriptadr=${1:-`whoami`} # Default to current user, if not specified.# Typing 'self-mailer.sh wiseguy@superdupergenius.com'#+ sends this script to that addressee.# Just 'self-mailer.sh' (no argument) sends the script#+ to the person invoking it, for example, bozo@localhost.localdomain.## For more on the ${parameter:-default} construct,#+ see the "Parameter Substitution" section#+ of the "Variables Revisited" chapter.# ============================================================================ cat $0 | mail -s "Script \"`basename $0`\" has mailed itself to you." "$adr"# ============================================================================# --------------------------------------------# Greetings from the self-mailing script.# A mischievous person has run this script,#+ which has caused it to mail itself to you.# Apparently, some people have nothing better#+ to do with their time.# --------------------------------------------echo "At `date`, script \"`basename $0`\" mailed to "$adr"."exit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?