⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 self-mailer.sh

📁 一本完整的描述Unix Shell 编程的工具书的所有范例
💻 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 + -