📄 self-mailer.sh
字号:
#!/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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -