home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / bin / foo2zjs-wrapper < prev    next >
Encoding:
Text File  |  2006-06-19  |  14.0 KB  |  587 lines

  1. #!/bin/sh
  2.  
  3. #* Copyright (C) 2003  Rick Richardson
  4. #*
  5. #* This program is free software; you can redistribute it and/or modify
  6. #* it under the terms of the GNU General Public License as published by
  7. #* the Free Software Foundation; either version 2 of the License, or
  8. #* (at your option) any later version.
  9. #*
  10. #* This program is distributed in the hope that it will be useful,
  11. #* but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #* GNU General Public License for more details.
  14. #*
  15. #* You should have received a copy of the GNU General Public License
  16. #* along with this program; if not, write to the Free Software
  17. #* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. #*
  19. #* Authors: Rick Richardson <rickr@mn.rr.com>
  20.  
  21. VERSION='$Id: foo2zjs-wrapper.in,v 1.91 2006/01/13 12:18:11 rick Exp $'
  22.  
  23. #
  24. # Printer Notes:
  25. #
  26. # Minolta/QMS 2300 DL    - Does not need clipping, -X16, or -P.  But it doesn't
  27. #              break anything if you use them.
  28. #
  29. # Minolta/QMS 2200 DL    - Requires -X16 (which is on by default)
  30. #            - Requires clipping
  31. #
  32. # HP LaserJet 1000    - Same as 2200 DL, plus needs -P
  33. # HP LaserJet 1005    - Same as 2200 DL, plus needs -P
  34. # HP LaserJet 1020    - Same as 2200 DL, plus needs -P -z1
  35. #
  36.  
  37. PROGNAME="$0"
  38. BASENAME=`basename $PROGNAME`
  39. PREFIX=/usr
  40. SHARE=$PREFIX/share/foo2zjs
  41.  
  42. #
  43. #    Log the command line, for debugging and problem reports
  44. #
  45. if [ -x /usr/bin/logger ]; then
  46.     logger -t "$BASENAME" -p lpr.info -- "foo2zjs-wrapper $@" </dev/null
  47. fi
  48.  
  49. usage() {
  50.     cat <<EOF
  51. Usage:
  52.     $BASENAME [options] [ps-file]
  53.  
  54.     Foomatic printer wrapper for the foo2zjs printer driver.
  55.     This script reads a Postscript ps-file or standard input
  56.     and converts it to Zenographics ZjStream printer format.
  57.  
  58. Normal Options:
  59. -c                Print in color (else monochrome)
  60. -d duplex         Duplex code to send to printer [$DUPLEX]
  61.                     1=off, 2=longedge, 3=shortedge
  62. -m media          Media code to send to printer [$MEDIA]
  63.                     1=standard, 2=transparency, 3=glossy, 257=envelope,
  64.                     259=letterhead, 261=thickstock, 262=postcard, 263=labels
  65. -p paper          Paper code [$PAPER]
  66.                     1=letter, 5=legal, 7=executive, 9=A4, 11=A5, 13=B5
  67. -n copies         Number of copies [$COPIES]
  68. -r <xres>x<yres>  Set device resolution in pixels/inch [$RES]
  69. -s source         Source code to send to printer [$SOURCE]
  70.                     1=upper, 2=lower, 4=manual, 7=auto
  71.             Code numbers may vary with printer model.
  72. -t                Draft mode.  Every other pixel is white.
  73. -2 / -4           2-up, 4-up
  74.  
  75. Printer Tweaking Options:
  76. -u <xoff>x<yoff>  Set offset of upper left printable in pixels [varies]
  77. -l <xoff>x<yoff>  Set offset of lower right printable in pixels [varies]
  78. -L mask           Send logical clipping values from -u/-l in ZjStream [3]
  79.                   0=no, 1=Y, 2=X, 3=XY
  80. -P                Do not output START_PLANE codes.  May be needed by some
  81.                   monochrome-only printers.
  82. -X padlen         Add extra zero padding to the end of BID segments [16]
  83. -z model          Model: 0=2300DL 1=hp1020 [0]
  84.  
  85. Color Tweaking Options:
  86. -g gsopts         Additional options to pass to Ghostscript, such as
  87.                   -dDITHERPPI=nnn, etc.  May appear more than once. []
  88. -G profile.icm    Convert profile.icm to a Postscript CRD using icc2ps and
  89.                   adjust colors using the setcolorrendering PS operator.
  90.                   $SHARE/icm/ will be searched for profile.icm.
  91. -I intent         Select profile intent from ICM file [$INTENT]
  92.                   0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute
  93. -G gamma-file.ps  Prepend gamma-file to the Postscript input to perform
  94.                   color correction using the setcolortransfer PS operator.
  95.  
  96. Debugging Options:
  97. -S plane          Output just a single color plane from a color print [all]
  98.                   1=Cyan, 2=Magenta, 3=Yellow, 4=Black
  99. -D lvl            Set Debug level [$DEBUG]
  100. -V                $VERSION
  101. EOF
  102.  
  103.     exit 1
  104. }
  105.  
  106. #
  107. #       Report an error and exit
  108. #
  109. error() {
  110.     echo "$BASENAME: $1" >&2
  111.     exit 1
  112. }
  113.  
  114. dbgcmd() {
  115.     if [ $DEBUG -ge 1 ]; then
  116.         echo "$@" >&2
  117.     fi
  118.     "$@"
  119. }
  120.  
  121. #
  122. #    N-up-ify the job.  Requires psnup from psutils package
  123. #
  124. nup2() {
  125.     tr '\r' '\n' | psnup -d2 -2 -m.3in -p$paper -q
  126. }
  127.  
  128. nup4() {
  129.     tr '\r' '\n' | psnup -d2 -4 -m.5in -p$paper -q
  130. }
  131.  
  132. #
  133. #       Process the options
  134. #
  135.  
  136. # Try to use a local copy of GhostScript 8.14, if available.  Otherwise,
  137. # fallback to whatever the Linux distro has installed (usually 7.05)
  138. #
  139. # N.B. := operator used here, when :- would be better, because "ash"
  140. # doesn't have :-
  141. if gs8 -v >/dev/null 2>&1; then
  142.         GSBIN=${GSBIN:-gs8}
  143. else
  144.         GSBIN=${GSBIN:-gs}
  145. fi
  146.  
  147. CMDLINE="$*"
  148. DEBUG=0
  149. DUPLEX=1
  150. COLOR=
  151. COLORMODE=0
  152. MODEL=0
  153. # What mode to use if the user wants us to pick the "best" mode
  154. case `$GSBIN --version` in
  155. 7*)    DEFAULTCOLORMODE=10
  156.     DEFAULTCOLORMODE=2
  157.     ;;
  158. *)    DEFAULTCOLORMODE=2
  159.     ;;
  160. esac
  161. QUALITY=1
  162. MEDIA=1
  163. COPIES=1
  164. test -r /etc/papersize && PAPER=$(cat /etc/papersize)
  165. test "$PAPER" || PAPER=1
  166. RES=1200x600
  167. SOURCE=7
  168. NUP=
  169. CLIP_UL=
  170. CLIP_LR=
  171. CLIP_LOG=
  172. BC=
  173. AIB=
  174. NOPLANES=
  175. COLOR2MONO=
  176. GAMMAFILE=
  177. INTENT=0
  178. GSOPTS=
  179. EXTRAPAD=
  180. SAVETONER=
  181. GSDEV=-sDEVICE=pbmraw
  182. while getopts "24b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt
  183. do
  184.     case $opt in
  185.     b)    GSBIN="$OPTARG";;
  186.     c)    COLOR=-c;;
  187.     d)    DUPLEX="$OPTARG";;
  188.     g)    GSOPTS="$GSOPTS $OPTARG";;
  189.     m)    MEDIA="$OPTARG";;
  190.     n)    COPIES="$OPTARG";;
  191.     p)    PAPER="$OPTARG";;
  192.     q)    QUALITY="$OPTARG";;
  193.     r)    RES="$OPTARG";;
  194.     s)    SOURCE="$OPTARG";;
  195.     t)    SAVETONER="-t";;
  196.     z)    MODEL="$OPTARG";;
  197.     l)    CLIP_LR="-l $OPTARG";;
  198.     u)    CLIP_UL="-u $OPTARG";;
  199.     L)    CLIP_LOG="-L $OPTARG";;
  200.     A)    AIB=-A;;
  201.     B)    BC=-B;;
  202.     C)    COLORMODE="$OPTARG";;
  203.     S)    COLOR2MONO="-S$OPTARG";;
  204.     D)    DEBUG="$OPTARG";;
  205.     G)    GAMMAFILE="$OPTARG";;
  206.     I)    INTENT="$OPTARG";;
  207.     P)    NOPLANES=-P;;
  208.     X)    EXTRAPAD="-X $OPTARG";;
  209.     2)    NUP="2";;
  210.     4)    NUP="4";;
  211.     V)    echo "$VERSION"; foo2zjs -V; exit 0;;
  212.     h|\?)
  213.         if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
  214.             echo "Illegal command:"
  215.             echo "    $0 $CMDLINE"
  216.             echo
  217.         fi
  218.         usage;;
  219.     esac
  220. done
  221. shift `expr $OPTIND - 1`
  222.  
  223. #
  224. case "$QUALITY" in
  225. 0)
  226.     GSOPTS="-dCOLORSCREEN $GSOPTS"
  227.     ;;
  228. 1)
  229.     GSOPTS="-dCOLORSCREEN $GSOPTS"
  230.     ;;
  231. 2)
  232.     GSOPTS="-dMaxBitMap=500000000 $GSOPTS"
  233.     ;;
  234. esac
  235.  
  236. #
  237. #    Validate model code
  238. #
  239. case "$MODEL" in
  240. 0|1)    ;;
  241. *)    error "Unknown model code $MODEL";;
  242. esac
  243.  
  244. #
  245. #    Validate media code
  246. #
  247. case "$MEDIA" in
  248. 1|standard)    MEDIA=1;;
  249. 2|transparency)    MEDIA=2;;
  250. 3|glossy)    MEDIA=3;;
  251. 257|envelope)    MEDIA=257;;
  252. 259|letterhead)    MEDIA=259;;
  253. 261|thickstock)    MEDIA=261;;
  254. 262|postcard)    MEDIA=262;;
  255. 263|labels)    MEDIA=263;;
  256. [0-9]*)        ;;
  257. *)        error "Unknown media code $MEDIA";;
  258. esac
  259.  
  260. #
  261. #    Validate source (InputSlot) code
  262. #
  263. case "$SOURCE" in
  264. 1|upper)    SOURCE=1;;
  265. 2|lower)    SOURCE=2;;
  266. 4|manual)    SOURCE=4;;
  267. 7|auto)        SOURCE=7;;
  268. [0-9]*)        ;;
  269. *)        error "Unknown source code $SOURCE";;
  270. esac
  271.  
  272. #
  273. #    Validate Duplex code
  274. #
  275. case "$DUPLEX" in
  276. 1|off|none)    DUPLEX=1;;
  277. 2|long*)    DUPLEX=2;;
  278. 3|short*)    DUPLEX=3;;
  279. [0-9]*)        ;;
  280. *)        error "Unknown duplex code $DUPLEX";;
  281. esac
  282.  
  283. #
  284. #    Validate Resolution
  285. #
  286. case "$RES" in
  287. 600x600)    ;;
  288. 1200x600)    ;;
  289. 2400x600)    ;;
  290. *)        error "Illegal resolution $RES";;
  291. esac
  292.  
  293. #
  294. #    Figure out the paper dimensions in pixels/inch, and set the
  295. #    default clipping region.  Unfortunately, this is a trouble
  296. #    area for ZjStream printers.  Various versions of ZjS print
  297. #    engines react differently when asked to print into their
  298. #    unprintable regions.
  299. #
  300. #    The Minolta 2200 DL is sensitive to its unprintable regions,
  301. #    and will pixel skew if you try to print there.
  302. #
  303. #    The HP1000 will print blank pages when asked to print into its
  304. #    unprintable region.
  305. #
  306. #    The Minolta 2300 DL doesn't care if print into the unprintable
  307. #    region.  It will do the clipping itself.  This is as it should be.
  308. #    But it won't hurt it if we do the clipping here.
  309. #
  310. set_clipping() {
  311.     ulx=$1; uly=$2
  312.     lrx=$3; lry=$4
  313.  
  314.     # Set clipping region if it isn't already set
  315.     if [ "$CLIP_UL" = "" ]; then
  316.     case "$RES" in
  317.     600x600)    ulx=`expr $ulx / 2`;;
  318.     2400x600)    ulx=`expr $ulx \* 2`;;
  319.     esac
  320.     CLIP_UL="-u ${ulx}x${uly}"
  321.     fi
  322.     if [ "$CLIP_LR" = "" ]; then
  323.     case "$RES" in
  324.     600x600)    lrx=`expr $lrx / 2`;;
  325.     2400x600)    lrx=`expr $lrx \* 2`;;
  326.     esac
  327.     CLIP_LR="-l ${lrx}x${lry}"
  328.     fi
  329. }
  330.  
  331. case "$PAPER" in
  332. 1|letter)    PAPER=1;    paper=letter;    XDIM="10200"; YDIM="6600"
  333.         case "$MODEL" in
  334.         0)    set_clipping 204 102    204 106;;
  335.         1)    set_clipping 192 96    192 96;;
  336.         # 1)    set_clipping 96 96    288 96;;
  337.         esac
  338.         ;;
  339. 5|legal)    PAPER=5;    paper=legal;     XDIM="10200"; YDIM="8400"
  340.         case "$MODEL" in
  341.         0)    set_clipping 204 102    204 106;;
  342.         1)    set_clipping 192 96    192 96;;
  343.         esac
  344.         ;;
  345. 7|executive)    PAPER=7;    paper=executive; XDIM="8700";  YDIM="6300"
  346.         case "$MODEL" in
  347.         0)    set_clipping 206 102    206 102;;
  348.         1)    set_clipping 192 96    192 96;;
  349.         esac
  350.         ;;
  351. 9|a4|A4)    PAPER=9;    paper=a4;        XDIM="9920";  YDIM="7016"
  352.         case "$MODEL" in
  353.         0)
  354.             if [ "$NOPLANES" != "" -a "$RES" = 600x600 ]; then
  355.             # Hack fix for LJ1000
  356.             set_clipping 224 100    224 100
  357.             else
  358.             # 2200DL
  359.             set_clipping 200 100    200 100
  360.             fi
  361.             ;;
  362.         1)    set_clipping 192 96    192 96;;
  363.         esac
  364.         ;;
  365. 11|a5|A5)    PAPER=11;    paper=a5;        XDIM="6992";  YDIM="4960"
  366.         case "$MODEL" in
  367.         0)    set_clipping 200 100    200 100;;
  368.         1)    set_clipping 192 96    192 96;;
  369.         esac
  370.         ;;
  371. 13|b5|B5)    PAPER=13;    paper=b5;        XDIM="8598";  YDIM="6070"
  372.         case "$MODEL" in
  373.         0)    set_clipping 207 107    207 107;;
  374.         1)    set_clipping 192 96    192 96;;
  375.         esac
  376.         ;;
  377. *)        error "Unimplemented paper code $PAPER";;
  378. esac
  379. PAPERSIZE="-sPAPERSIZE=$paper";
  380.  
  381. case "$RES" in
  382. 600x600)    XDIM=`expr $XDIM / 2`;;
  383. 1200x600)    ;;
  384. 2400x600)    XDIM=`expr $XDIM \* 2`;;
  385. esac
  386. DIM="${XDIM}x${YDIM}"
  387.  
  388. #
  389. # If there is an argument left, take it as the file to print.
  390. # Else, the input comes from stdin.
  391. #
  392. if [ $# -ge 1 ]; then
  393.     if [ "$LPJOB" = "" ]; then
  394.     : # LPJOB="$1"
  395.     fi
  396.     exec < $1
  397. fi
  398.  
  399. #
  400. # Filter thru psnup if N-up printing has been requested
  401. #
  402. case $NUP in
  403. 2)    PREFILTER="nup2";;
  404. 4)    PREFILTER="nup4";;
  405. *)    PREFILTER=cat;;
  406. esac
  407.  
  408. #
  409. #    Overload -G.  If the file name ends with ".icm" or ".ICM"
  410. #    then convert the ICC color profile to a Postscript CRD,
  411. #    then prepend it to the users job.  Select the intent
  412. #    using the -I option.
  413. #
  414.  
  415. create_crd() {
  416.     #
  417.     # Create a Postscript CRD
  418.     #
  419.     ICC2PS=$PREFIX/bin/foo2zjs-icc2ps
  420.     if [ -x $ICC2PS ]; then
  421.     $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
  422.     || error "Problem converting .ICM file to Postscript"
  423.     cat > $ICCTMP.usecie.ps <<-EOF
  424.         %!PS-Adobe-3.0
  425.         <</UseCIEColor true>>setpagedevice
  426.     EOF
  427.     cat > $ICCTMP.selcrd.ps <<-EOF
  428.         /Current /ColorRendering findresource setcolorrendering
  429.     EOF
  430.     GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps"
  431.     else
  432.     GAMMFILE=
  433.     fi
  434. }
  435.  
  436. if [ $DEBUG -gt 0 ]; then
  437.     ICCTMP=/tmp/icc
  438. else
  439.     ICCTMP=/tmp/icc$$
  440. fi
  441.  
  442. if [ "" = "$COLOR" ]; then
  443.     COLORMODE=
  444.     GAMMAFILE=
  445. else
  446.     case "$COLORMODE" in
  447.     0)    COLORMODE=$DEFAULTCOLORMODE;;
  448.     esac
  449. fi
  450.  
  451. CRDBASE="$PREFIX/share/foo2zjs/crd"
  452. case "$RES" in
  453.     600x600)    COLORMODE=;;
  454.     1200x600)    SCREEN=screen1200.ps;;
  455.     2400x600)    SCREEN=screen2400.ps;;
  456. esac
  457.  
  458. case "$COLORMODE" in
  459. "")
  460.     # Monochrome
  461.     ;;
  462. 10|icm)
  463.     # Use old ICM method
  464.     AIB=-A
  465.     BC=-B
  466.     case "$GAMMAFILE" in
  467.     *.icm|*.ICM|*.icc|*.ICC)
  468.     #
  469.     # Its really an .ICM file, not a gamma file.
  470.     #
  471.     # The file can be a full path name, or the name of a file in $SHARE/icm/
  472.     #
  473.     if [ -r "$GAMMAFILE" ]; then
  474.         create_crd
  475.     elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then
  476.         GAMMAFILE="$SHARE/icm/$GAMMAFILE"
  477.         create_crd
  478.     else
  479.         GAMMAFILE=
  480.     fi
  481.     ;;
  482.     esac
  483.     ;;
  484. 1|photo)
  485.     # Photo
  486.     GAMMAFILE="$CRDBASE/prolog.ps"
  487.     GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr125,75-per.crd"
  488.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  489.     ;;
  490. 2|graphics)
  491.     # Photo and Text
  492.     GAMMAFILE="$CRDBASE/prolog.ps"
  493.     #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,75-per.crd"
  494.     GAMMAFILE="$GAMMAFILE $CRDBASE/kh.crd"
  495.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  496.     ;;
  497. 3|text)
  498.     # Graphic and Text
  499.     GAMMAFILE="$CRDBASE/prolog.ps"
  500.     #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,50-per.crd"
  501.     GAMMAFILE="$GAMMAFILE $CRDBASE/kx.crd"
  502.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  503.     ;;
  504. 4|tonersave)
  505.     # Reduced toner
  506.     GAMMAFILE="$CRDBASE/prolog.ps"
  507.     GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,0-per.crd"
  508.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  509.     ;;
  510. *.crd)
  511.     GAMMAFILE="$CRDBASE/prolog.ps"
  512.     if [ -f $COLORMODE ]; then
  513.     GAMMAFILE="$GAMMAFILE $COLORMODE"
  514.     elif [ -f $CRDBASE/$COLORMODE ]; then
  515.     GAMMAFILE="$GAMMAFILE $CRDBASE/$COLORMODE"
  516.     else
  517.     error "Can't find CRD '$COLORMODE' in . or in $CRDBASE"
  518.     fi
  519.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  520.     ;;
  521. *)
  522.     error "Unknown color method '$COLORMODE'"
  523.     ;;
  524. esac
  525.  
  526. if [ "" != "$COLOR" ]; then
  527.     if [ "" = "$AIB" -a "" = "$BC" ]; then
  528.     # Faster, but can't handle AllIsBlack or BlackClears
  529.     GSDEV=-sDEVICE=pksmraw
  530.     else
  531.     # Can't handle different size pages
  532.     GSDEV=-sDEVICE=bitcmyk
  533.     fi
  534. fi
  535.  
  536. #
  537. #    Figure out USERNAME
  538. #
  539. if [ "$LPUSER" != "" ]; then
  540.     USER="$LPUSER@$LPHOST"
  541. else
  542.     USER=""
  543. fi
  544.  
  545. #
  546. #    Main Program, just cobble together the pipeline and run it
  547. #
  548. #    The malarky with file descriptors 1 and 3 is to avoid a bug in
  549. #    (some versions?) of Ghostscript where Postscript's stdout gets
  550. #    intermingled with the printer drivers output, resulting in
  551. #    corrupted image data.
  552. #
  553. GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
  554.  
  555. $PREFILTER \
  556. | ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
  557.     -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null) 3>&1 \
  558. | foo2zjs -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
  559.         -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
  560.         -J "$LPJOB" -U "$USER" \
  561.         $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG
  562.  
  563. #
  564. #    Log the command line, for debugging and problem reports
  565. #
  566. if [ -x /usr/bin/logger ]; then
  567.     logger -t "$BASENAME" -p lpr.info -- \
  568.     "$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPT $GAMAFILE"
  569.     logger -t "$BASENAME" -p lpr.info -- \
  570.     "foo2zjs -r$RES -g$DIM -p$PAPER -m$MEDIA \
  571. -n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \
  572. $SAVETONER $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD"
  573. fi
  574.  
  575. #
  576. #    Remove cruft
  577. #
  578. if [ $DEBUG -eq 0 ]; then
  579.     for i in crd.ps log usecie.ps selcrd.ps
  580.     do
  581.     file="$ICCTMP.$i"
  582.     [ -f $file ] && rm -f $file
  583.     done
  584. fi
  585.  
  586. exit 0
  587.