wood burning stoves
The moose likes General Computing and the fly likes DOS/Shell Output from Exe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "DOS/Shell Output from Exe" Watch "DOS/Shell Output from Exe" New topic

DOS/Shell Output from Exe

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 832
Hi All,
What I'm "trying" to accomplish will need some explanation, hopefully someone has some helpful info on this.
I have a program that will spit out content to the terminal (TCL) on Windows or Unix. Each line varies in length so one line in the program may wrap to 10 in DOS or some other number in Unix. Is there a way I can tell DOS or the Shell to display a page full of content, break, ask the user a question (i.e. wish to continue, wish to accept agreement, etc..,), and based on the answer either continue, quit out of the displaying of the text, or just quit altogether? It's a perl script that doing this but I'm hoping someone may have had a similar issue with other languages:

Read in a text document that has 6 paragraphs. When perl spits this out in DOS it's about 100 lines (wrapping and so forth).
I want to say "Press Y to contiue displaying text or N to stop display".
Based on the response I want to do the obvious.
Since the perl script just prints the entire file's contents in one shot I'm a bit unsure if I can accomplish this or not.
Any help would be greatly appreciated. Thanks.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19861

The easiest way in both Windows and Unix is to pipe the output of that program into the "more" command. Like this at the command line:
YourScript | more
I agree. Here's the link: http://aspose.com/file-tools
subject: DOS/Shell Output from Exe
It's not a secret anymore!