65fbe0ce09ad8f058a3e2f53f55162eb22e22c1e
[elisp/tm.git] / methods / tmdecode
1 #!/bin/sh -
2 #
3 # $Id: tmdecode,v 3.0 1995/12/18 11:36:36 morioka Exp morioka $
4 #
5
6 trap 'rm -f $2' 0 1 2 3 13 15
7
8 case "$3" in
9 /dev/stdout)
10         OUTPUT=
11         ;;
12 *)
13         OUTPUT='> $3'
14         ;;
15 esac
16
17 case "$1" in
18 ""|"7bit"|"8bit"|"binary")
19         eval "cat $2 $OUTPUT"
20         ;;
21 "base64")
22         #eval "decode-b < $2 $OUTPUT"
23         eval "mmencode -u $2 $OUTPUT"
24         ;;
25 "quoted-printable")
26         eval "mmencode -q -u $2 $OUTPUT"
27         ;;
28 "x-uue"|"x-uuencode")
29         (cd $TM_TMP_DIR ; uudecode $2)
30         ;;
31 "x-gzip64")
32         #eval "decode-b < $2 | gzip -cd $OUTPUT"
33         eval "mmencode -u $2 | gzip -cd $OUTPUT"
34         ;;
35 *)
36         echo "unknown encoding"
37         exit -1
38         ;;
39 esac
40
41 # echo "$2 was removed."