view miscellany/scripts/append.sh @ 17:76d91e545ea8 default tip

addrsbr and dtimep fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 24 Nov 2014 14:49:25 +0900
parents bce86c4163a3
children
line wrap: on
line source

: append editor for mh -- /jlr and bd

case $# in
1)	msg=$1; echo -n 'Append file(s):  ' 1>&2; read appendix;;
2)	msg=$2; appendix=$1;;
*)	echo 1>&2 "Usage:  `basename $0` [file]"; exit 1;;
esac

for arg in $appendix
do
	if [ -f $arg -a -r $arg ]	# exists; non-directory; readable
	then
		echo 1>&2 \"$arg\" 	# yell the file name out
		cat </dev/null $arg >>$msg
	else
		echo 1>&2 "`basename $0` $arg:  Sorry."
	fi
done