How to copy text chars in shell mode to a text file?
James Wilkinson
james at westexe.demon.co.uk
Mon Nov 8 13:28:20 UTC 2004
Nguyen Dinh Kien wrote:
> yes, i have advice to write a shell script to capture all output of a
> running program to a file. But it is hard for me to learn shell now,
> can u tell me that script and a demo command? especial thank.
Not quite: use the script command, not write a shell script.
For example:
> [james at howells james]$ script out.txt
> Script started, file is out.txt
> [james at howells james]$ ls
> contents
> [james at howells james]$ exit
> Script done, file is out.txt
and the contents of out.txt are:
> Script started on Mon 08 Nov 2004 13:22:08 GMT
> [james at howells james]$ ls
> contents
> [james at howells james]$ exit
>
> Script done on Mon 08 Nov 2004 13:22:13 GMT
You can use Ctrl-D to quit.
Depending on what you're doing you might find
TERM=dumb script out.txt
to be better. ("Why" is left as an exercise for the reader...)
Hope this helps,
James.
--
E-mail address: james | Why did the chicken cross the Möbius strip?
@westexe.demon.co.uk |
More information about the fedora-list
mailing list