5
2
Back in university, when we had to submit an assignment in CS, we would have to perform a series of steps including running script, date, whoami, etc.
, and then running our program.
The script
command would pipe all text sent to the display to both the display and a specified file as well.
Ever since, I have been looking for a Dos and/or Windows version, but have come up empty. Some programs can be redirected to a file, but then the display is not echoed, and some programs don’t seem to work with redirection at all.
Any ideas?
Edit:
So far, the answers that I’ve gotten seem to work exactly like the standard redirection commands (<, >, |
). These do not work with all programs. For example, the Microsoft C++ compiler CL.EXE. If you run cl /?
through a redirection command or pipe it through another program (such as TEE), you will not get the header/banner text.
Another example is a program I wrote a while back in Pascal (I think the last compile was in FreePascal). The help text does not get redirected at all. I have seen this occur with other programs as well like MKISOFS. It has a long help text, but cannot be paused by piping it through MORE or redirected to a file!
I have wondered about this for many years. I used to think that it may be because the text is being written directly to the screen (eg port B800) or something, but I have yet to pin down the cause, let alone find a program that can do this job.
If you try to intercept direct screen writes, you're bound to have compatibility problems. Better approach may be to use a TSR that can read the screen contents. I do bet screen capture programs work. Capture the info after it is written, rather than before it is written, and you'll probably have less compatibility issues. Is 20CC available? I find the grey background hideous, but the concept is intriguing. If it's customizable (gotta love source code), I'd be interested enough to snag a copy. Did a quick search online and didn't find it yet. – TOOGAM – 2015-02-14T07:28:27.707
Looking at that screen again, it looks super buggy. :( "Largest availabel upper memory bemory", and "0 bytes available contiguous extended m". And how many bytes are used by the "MS-DOS resident in High Memory Area?" It looks like some hyphens have been moved. This happened twice; in both cases, they should be under the words "Size in Hex", but look like they overwrote yet more information. – TOOGAM – 2015-02-16T15:59:25.277
Have you been using it for a while and does it work reliably (no serious bugs that haven't been ironed out due to lack of time/interest)? Could you perhaps edit your answer to provide a link to the program's source code if you still have it? I'm looking for the same thing (a port of
tee
). – Agi Hammerthief – 2015-09-25T22:16:16.080(Technically this is actually a port of
tee
, notscript
, but it’ll have to do.) – Synetech – 2013-10-18T02:08:15.683