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