|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
How can I dump the contents of my command shell buffer to a file,
using recent bash? I googled up an exmple using zsh but I don't really want to use zsh |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Harry Putnam wrote:
> How can I dump the contents of my command shell buffer to a file, > using recent bash? You mean the shell's command history? Try 'history' or 'fc -l' (with appropriate arguments to view more than the default) and redirect the output. Janis > > I googled up an exmple using zsh but I don't really want to use zsh |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Harry Putnam wrote:
> How can I dump the contents of my command shell buffer to a file, > using recent bash? history > filename -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Wed, 02 Jan 2008 22:16:29 +0100, Janis Papanagnou
<Janis_Papanagnou@hotmail.com> wrote: >Harry Putnam wrote: >> How can I dump the contents of my command shell buffer to a file, >> using recent bash? > >You mean the shell's command history? Yikes no... I must have been unclear I want to dump the contents of a command shell buffer. The stuff that accrues in your shell buffer as you work. I keep a large number of lines in the buffer and every once in a while I want something from way up there that has long ago scrolled off the screen but is still withing the line limit of my fuffer. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Harry Putnam scrisse:
> How can I dump the contents of my command shell buffer to a file, > using recent bash? I think script can be useful man script |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On 1/2/2008 3:29 PM, Harry Putnam wrote: > On Wed, 02 Jan 2008 22:16:29 +0100, Janis Papanagnou > <Janis_Papanagnou@hotmail.com> wrote: > > >>Harry Putnam wrote: >> >>>How can I dump the contents of my command shell buffer to a file, >>>using recent bash? >> >>You mean the shell's command history? > > > Yikes no... I must have been unclear > > I want to dump the contents of a command shell buffer. > > The stuff that accrues in your shell buffer as you work. That still sounds like your shell's command history. Can you give us any more information on this "buffer" (e.g. where it's documented or variables/commands through which you control/access it)? > I keep a large number of lines in the buffer and every once in a while > I want something from way up there that has long ago scrolled off the > screen but is still withing the line limit of my fuffer. It's still not clear what you're looking for, but it sounds like maybe you want to see some text that was displayed on your screen but has now disappeared off the top of the window it was displayed in. If so, you need to look at the documentation for whatever windowing system you're using rather than your shell. For example, if you're using xterms, scrollbars can be enabled with the appropriate options when you start the xterm, or with the appropriate control-button sequence while the xterm is already running. Ed. |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
Harry Putnam wrote:
> On Wed, 02 Jan 2008 22:16:29 +0100, Janis Papanagnou > <Janis_Papanagnou@hotmail.com> wrote: > > >>Harry Putnam wrote: >> >>>How can I dump the contents of my command shell buffer to a file, >>>using recent bash? >> >>You mean the shell's command history? > > > Yikes no... I must have been unclear > > I want to dump the contents of a command shell buffer. I've never heared of a "command shell buffer", besides the command line history. > > The stuff that accrues in your shell buffer as you work. > > I keep a large number of lines in the buffer and every once in a while > I want something from way up there that has long ago scrolled off the > screen but is still withing the line limit of my fuffer. Usually you have to take actions _in advance_ to get the contents of the screen that is no longer visible. The various windowing systems support different concepts; like specifying (visible and scrollable) buffer sizes and enabling scroll buttons. If you want to log all output on shell level you have to use a "wrapper" *before* you start logging; the 'screen' command will do that. Janis |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On Wed, 02 Jan 2008 22:39:12 +0100, "mallin.shetland"
<mallin.shetland@aol.com> wrote: >Harry Putnam scrisse: > >> How can I dump the contents of my command shell buffer to a file, >> using recent bash? > >I think script can be useful usefull yes but not what I'm after. I don't want to have to monkey around with control characters in the ouput. Or other nasties one gets in a `typescript'. I guess those would probably occur by dumping too though. But the worst is having to start and stop the script. I mean, its not world shaking but just more baloney to mess around with. To me it would be much handier to do: dumpcmd|grep something or dumpcmd|tee file|grep something Where I would quickly find what I wnated and have a full record of the content. For all who have responded: The buffer is the area of an xterm (or console teminal) . The same place one finds the command prompt... hence the term I used `command shell buffer' The memory or content of the shell buffer where the command prompt is. Its documented well in man xterm and Thomas Dickie has written untold numbers of anserers about the control switches here and in other comp.unix groups. The one that controls the number of lines saved `savedlines' is `-sl' I've set it as high as 30,000 thousand for some tests once but generally set it around 8,000 (Note: I'm not sure a console login offers a mechanism to change the buffer or `lines saved' ) However when I do want something from in there it involves a lot of scrolling and squinting. I've often thought how nice it would be to be able to grep it. So if it were dumpted to a file I could do that handily. `script' can accomplish that but in a more round about way. |
|
![]() |
| Outils de la discussion | |
|
|