Mercurial > hg > Applications > mh
annotate miscellany/multi-media/misc/mimeless @ 0:bce86c4163a3
Initial revision
author | kono |
---|---|
date | Mon, 18 Apr 2005 23:46:02 +0900 |
parents | |
children |
rev | line source |
---|---|
0 | 1 #!/bin/sh |
2 : mhn-show-text/plain: mimeless "%d" text/%s '%F' | |
3 | |
4 if [ $# != 3 ]; then | |
5 echo "usage: $0 message-1 message-2 file-name" 1>&2 | |
6 exit 1 | |
7 fi | |
8 | |
9 if [ ! -r $3 ]; then | |
10 echo "File does not exist." 1>&2 | |
11 exit 1 | |
12 fi | |
13 | |
14 msg1=`echo $1 | sed -e 's/\%/\\\%/g' -e 's/\?/\\\?/g' -e 's/:/\\:/g' \ | |
15 -e 's/\./\\\./g' -e 's/\"/\\\"/g'` | |
16 msg2=`echo $2 | sed -e 's/\%/\\\%/g' -e 's/\?/\\\?/g' -e 's/:/\\:/g' \ | |
17 -e 's/\./\\\./g' -e 's/\"/\\\"/g'` | |
18 | |
19 exec less -P"\"${msg1}\" ${msg2} ?pB%pB\%.%t" $3 |