Skip to content

Commit 0d77dd3

Browse files
committed
stec-submit
1 parent e680466 commit 0d77dd3

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

stec-submit

+12-18
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
11
#!/bin/zsh
22

3-
4-
3+
student_number=201111365
4+
student_name=坂口和彦
5+
alias mail_command="ssh `coins-imac` 'sendmail -t'"
56

67
attachment(){
7-
cat <<EOT
8-
Content-Type: text/plain; charset=UTF-8; name="$1"
9-
Content-Disposition: attachment; filename="$1"
8+
<<EOT
9+
------
10+
Content-Type: $1; charset=$2
11+
Content-Disposition: attachment; filename="$3"
1012
Content-Transfer-Encoding: base64
1113
1214
EOT
1315
base64
1416
}
1517

1618
{
17-
cat <<EOT
18-
From: $from_addr
19-
To: $to_addr
19+
<<EOT
20+
2021
Subject: STEC:report
2122
Content-Type: multipart/mixed; boundary="----"
2223
23-
------
24-
EOT
25-
attachment student.txt <<EOT
26-
201111365
27-
坂口和彦
2824
EOT
29-
for f in $@ ; do
30-
echo ------
31-
attachment "stec-`head -n 1 $f | tail -c +2`.rkt" < $f
32-
done
25+
(echo $student_number ; echo $student_name) | attachment text/plain UTF-8 student.txt
26+
for f in $@ ; attachment text/x-scheme UTF-8 "stec-`head -n 1 $f | tail -c +2`.rkt" < $f
3327
echo --------
34-
} | ssh `coins-imac` "sendmail -t"
28+
} | mail_command

0 commit comments

Comments
 (0)