home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / ibm / pc / misc / 15908 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  2.4 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!agate!alsu
  2. From: alsu@ocf.berkeley.edu (Alan Su)
  3. Newsgroups: comp.sys.ibm.pc.misc
  4. Subject: Re: How to create a "more" batch file?
  5. Message-ID: <1gp707INN8l8@agate.berkeley.edu>
  6. Date: 17 Dec 92 06:33:43 GMT
  7. References: <1992Dec11.235700.19707@mnemosyne.cs.du.edu> <gilligan.724122440@cs1.bradley.edu> <1992Dec14.162702.9385@iscsvax.uni.edu>
  8. Distribution: na
  9. Organization: U.C. Berkeley Open Computing Facility
  10. Lines: 46
  11. NNTP-Posting-Host: tornado.berkeley.edu
  12.  
  13. In article <1992Dec14.162702.9385@iscsvax.uni.edu> kraai4712@iscsvax.uni.edu writes:
  14. |>In article <gilligan.724122440@cs1.bradley.edu>, gilligan@cs1.bradley.edu (Edward Henigin) writes:
  15. |>> In <1992Dec11.235700.19707@mnemosyne.cs.du.edu> mrosen@nyx.cs.du.edu (Michael Rosen) writes:
  16. |>>>Is there a way I can write a batch file that will allow me to type 
  17. |>>>more file.txt
  18. |>> more < file.txt
  19. |> or
  20. |>> more < %1
  21. |>
  22. |>Assuming you are successful in executing the batch file, it will throw you into
  23. |>some effectively infinite recursion.
  24. |>
  25. |>Here's how to fix it.
  26. |>
  27. |>1)  Make sure that your MORE.BAT is ahead of your MORE.COM in your PATH.
  28. |>2)  Give your MORE.BAT the full path to MORE.COM.
  29. |>
  30. |>For example:
  31. |>
  32. |>MORE.BAT
  33. |>-----------------------------------
  34. |>C:\DOS\MORE < %1
  35. |>
  36. |>Of course this still wouldn't work of C:\DOS was your current working
  37. |>directory, it would get the MORE.COM before it began searching the path.
  38. |>
  39. |>To combat these problems, it would suffice to create a batch file with a
  40. |>different name than MORE, so there wouldn't be any danger of tripping the
  41. |>MORE.COM or of entering some non-ending recursion in a batch file.
  42. |>
  43. |>If you want a way to type multiple filenames with pauses in-between, let me
  44. |>know and I'll put it together for you.  It involves some intentional batch-file
  45. |>recursion and is IMHO, very interesting.  It's exposed in the User-to-User
  46. |>column of a recent PC Magazine.
  47. |>
  48. |>Hope this complicated things hopelessly.  :-)    --jim
  49. OK, here's the true challenge.  I want to be able to use the same "more
  50. <filename>".  However, is there a way to also achieve the same "pipe"
  51. behavior as in UNIX?  For example:
  52.  <C:\><some command that produces output> | more
  53. I want to do this without having to specify the full path to my dos
  54. directory.  Anyway to do this?  (I know this sounds like I want to have my
  55. cake and eat it too, but there *must* be a way...)
  56. -- 
  57. -alan su
  58. -alsu@ocf.berkeley.edu
  59.