behead.sh

来自「Shall高级编程」· Shell 代码 · 共 25 行

SH
25
字号
#! /bin/sh# Strips off the header from a mail/News message i.e. till the first# empty line# Mark Moraes, University of Toronto# ==> These comments added by author of this document.if [ $# -eq 0 ]; then# ==> If no command line args present, then works on file redirected to stdin.	sed -e '1,/^$/d' -e '/^[ 	]*$/d'	# --> Delete empty lines and all lines until 	# --> first one beginning with white space.else# ==> If command line args present, then work on files named.	for i do		sed -e '1,/^$/d' -e '/^[ 	]*$/d' $i		# --> Ditto, as above.	donefi# ==> Exercise: Add error checking and other options.# ==># ==> Note that the small sed script repeats, except for the arg passed.# ==> Does it make sense to embed it in a function? Why or why not?

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?