PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > How to dump content of cmd shell buffer
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

How to dump content of cmd shell buffer

Réponse
 
LinkBack Outils de la discussion
Vieux 02/01/2008, 21h10   #1
Harry Putnam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How to dump content of cmd shell buffer

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
  Réponse avec citation
Vieux 02/01/2008, 21h16   #2
Janis Papanagnou
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to dump content of cmd shell buffer

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

  Réponse avec citation
Vieux 02/01/2008, 21h17   #3
Cyrus Kriticos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to dump content of cmd shell buffer

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.
  Réponse avec citation
Vieux 02/01/2008, 21h29   #4
Harry Putnam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to dump content of cmd shell buffer

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.
  Réponse avec citation
Vieux 02/01/2008, 21h39   #5
mallin.shetland
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to dump content of cmd shell buffer

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
  Réponse avec citation
Vieux 02/01/2008, 22h21   #6
Ed Morton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to dump content of cmd shell buffer



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.

  Réponse avec citation
Vieux 02/01/2008, 22h33   #7
Janis Papanagnou
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to dump content of cmd shell buffer

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
  Réponse avec citation
Vieux 02/01/2008, 23h51   #8
Harry Putnam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to dump content of cmd shell buffer

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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h42.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,21381 seconds with 16 queries