mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
Use 9 file always.
This commit is contained in:
parent
f3832660d4
commit
5dde0bbad8
1 changed files with 11 additions and 3 deletions
14
bin/page
14
bin/page
|
@ -28,7 +28,7 @@ xfile()
|
||||||
then
|
then
|
||||||
echo 'troff intermediate output'
|
echo 'troff intermediate output'
|
||||||
else
|
else
|
||||||
file - < "$1"
|
9 file < "$1" | sed 's/stdin: //'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,9 @@ main()
|
||||||
*PS*)
|
*PS*)
|
||||||
psv $1
|
psv $1
|
||||||
;;
|
;;
|
||||||
|
*postscript*)
|
||||||
|
psv $1
|
||||||
|
;;
|
||||||
*PostScript*)
|
*PostScript*)
|
||||||
psv $1
|
psv $1
|
||||||
;;
|
;;
|
||||||
|
@ -64,7 +67,8 @@ case $# in
|
||||||
0)
|
0)
|
||||||
tmp=/var/tmp/page.$$.tmp
|
tmp=/var/tmp/page.$$.tmp
|
||||||
cat >$tmp
|
cat >$tmp
|
||||||
case "`xfile $tmp`" in
|
type=`xfile $tmp`
|
||||||
|
case "$type" in
|
||||||
*troff*)
|
*troff*)
|
||||||
mv $tmp $tmp.tr
|
mv $tmp $tmp.tr
|
||||||
tmp=$tmp.tr
|
tmp=$tmp.tr
|
||||||
|
@ -81,6 +85,10 @@ case $# in
|
||||||
mv $tmp $tmp.ps
|
mv $tmp $tmp.ps
|
||||||
tmp=$tmp.ps
|
tmp=$tmp.ps
|
||||||
;;
|
;;
|
||||||
|
*postscript*)
|
||||||
|
mv $tmp $tmp.ps
|
||||||
|
tmp=$tmp.ps
|
||||||
|
;;
|
||||||
*GIF*)
|
*GIF*)
|
||||||
mv $tmp $tmp.gif
|
mv $tmp $tmp.gif
|
||||||
tmp=$tmp.gif
|
tmp=$tmp.gif
|
||||||
|
@ -98,7 +106,7 @@ case $# in
|
||||||
tmp=$tmp.png
|
tmp=$tmp.png
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo 1>&2 page: unrecognized file type on standard input
|
echo 1>&2 page: unrecognized file type on standard input: $type
|
||||||
rm -f $tmp
|
rm -f $tmp
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue