annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bce86c4163a3 Initial revision
kono
parents:
diff changeset
1 : append editor for mh -- /jlr and bd
bce86c4163a3 Initial revision
kono
parents:
diff changeset
2
bce86c4163a3 Initial revision
kono
parents:
diff changeset
3 case $# in
bce86c4163a3 Initial revision
kono
parents:
diff changeset
4 1) msg=$1; echo -n 'Append file(s): ' 1>&2; read appendix;;
bce86c4163a3 Initial revision
kono
parents:
diff changeset
5 2) msg=$2; appendix=$1;;
bce86c4163a3 Initial revision
kono
parents:
diff changeset
6 *) echo 1>&2 "Usage: `basename $0` [file]"; exit 1;;
bce86c4163a3 Initial revision
kono
parents:
diff changeset
7 esac
bce86c4163a3 Initial revision
kono
parents:
diff changeset
8
bce86c4163a3 Initial revision
kono
parents:
diff changeset
9 for arg in $appendix
bce86c4163a3 Initial revision
kono
parents:
diff changeset
10 do
bce86c4163a3 Initial revision
kono
parents:
diff changeset
11 if [ -f $arg -a -r $arg ] # exists; non-directory; readable
bce86c4163a3 Initial revision
kono
parents:
diff changeset
12 then
bce86c4163a3 Initial revision
kono
parents:
diff changeset
13 echo 1>&2 \"$arg\" # yell the file name out
bce86c4163a3 Initial revision
kono
parents:
diff changeset
14 cat </dev/null $arg >>$msg
bce86c4163a3 Initial revision
kono
parents:
diff changeset
15 else
bce86c4163a3 Initial revision
kono
parents:
diff changeset
16 echo 1>&2 "`basename $0` $arg: Sorry."
bce86c4163a3 Initial revision
kono
parents:
diff changeset
17 fi
bce86c4163a3 Initial revision
kono
parents:
diff changeset
18 done