Re: How to copy text chars in shell mode to a text file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@howells james]$ script out.txt
> Script started, file is out.txt
> [james@howells james]$ ls
> contents
> [james@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@howells james]$ ls
> contents
> [james@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  | 


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux