Op 18-11-12 18:30, Felix Miata schreef:
On 2012-11-18 15:03 (GMT+0100) Oddball composed:
So i assume the text can not be captured at this time?
I've never found a solution for what you want to do. It may be that the programs gpm or screen can enable it, but I've never investigated those. I use one of three workarounds to get tty content into a file.
1-switch to X, run the same commands in Konsole, then copy and paste to a file
2-use the up arrow to put the previous command onto cmdline, append redirection, then <ENTER> (This is similar to what follows in #3, but is limited to one command at a time)
3-utilize the content of ~/.bash_history to run the same commands with redirection to put their output into a file
As example of #3, say you want the output from the last 5 tty commands. Then:
A: log out then back in to bring .bash_history current B: # tail -n5 $HOME/.bash_history > $HOME/hist.sh C: edit $HOME/hist.sh. To do this I F4, as I'm doing it all in midnight commander to start with, not a naked shell prompt. While editing, the existing lines can be copied and converted to comment lines so that it's easy to tell in the resulting output file where output from the various commands begin and end. You can add or delete commands as well. The key point in editing is to add the redirection to each uncommented line. The first line gets '> somefilename'. All the others get '>> somefilename'. You may find some commands need &> or &>> or other special redirection syntax. If you want somefilename to land in a particular place, then you need to use a full pathname each time. D: sh $HOME/hist.sh
After D: you'll have a somefilename containing the same output you originally had on the tty, subject to whatever modifications and redirect syntax errors you may have made while editing, and with command prompts absent.
$HOME is unnecessary above, except for its first instance in B: unless you're in $HOME to start with, if you want hist.sh to be in the current directory instead of where you know you'll be able to find it later.
Obviously, repeating everything in Konsole so that you can copy and paste to a file is easier than my script workaround. The script workaround is most useful when you need to repeat the process later and/or on other machines, same as with scripts generally.
I don't know if i did something wrong, but after a while the file i created: script -a ~/Documenten/terminal.txt did and does not upgrade anymore output from a tty. Rebooting and entering the same command stil did not change this. I tried to clean-up the history from the up-arrow key, but did not succeed also. And it really has to be done, as a lot of crap ended up there experimenting with gpm. Which is able to copy text and paste it in another tty, however, there is no way to get it to a terminal or textfile in init5. So, i will take a closer look at your 'manual'... ;-) (thanks for your input..) -- Have a nice day, Oddball. OS: Linux 3.7.0-rc5-2-desktop i686 Huidige gebruiker: oddball@EeePc-Rob-SFN9 Systeem: openSUSE 12.2 (i586) KDE: 4.9.3 "release 520" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org