projects
/
mmh
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Removed unused local variables to eliminate warnings from gcc 4.6.2.
[mmh]
/
uip
/
sendfiles.sh
1
#!/bin/sh
2
#
3
# Send multiples files non-interactively
4
5
# adjust if needed
6
attachment_header='Attach'
7
8
9
if [ $# -lt 3 ]; then
10
echo 'usage: sendfiles RECIPIENT SUBJECT FILES...' 1>&2
11
exit 1;
12
fi
13
14
rcpt="$1"
15
shift
16
subject="$1"
17
shift
18
19
cat 1>&2 <<!
20
Recipient: $rcpt
21
Subject: $subject
22
Files: $*
23
!
24
25
draft=`mktemp /tmp/sendfiles.XXXXXX`
26
trap 'rm -f "$draft"' 1 2 3 15
27
cat >"$draft" <<!
28
To: $rcpt
29
Subject: $subject
30
!
31
for i in "$@" ; do
32
echo "$attachment_header: $i" >>"$draft"
33
done
34
35
send "$draft"