public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] OT: need text viewer with delete and multiple files
@ 2005-12-13  1:52 Daevid Vincent
  2005-12-13  4:15 ` Richard Fish
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Daevid Vincent @ 2005-12-13  1:52 UTC (permalink / raw
  To: gentoo-user

After doing an emerge world (for example), I have a gazillion
/var/log/portage-logs to wade through to see if I need to follow any further
instructions (*sigh*)

Is there any recommended text viewer/editor whereby I can easily step
through the files (previous/next file), read .gz files, jump to the end of a
file, and most importantly, delete the current file?

'less /var/log/portage-logs/*' has most of these features, but it is sadly
missing the delete mode (at least I don't know it).

:n = next file
:p = previous file
:d = delete the file from a list (but not the file system)
Shift+G = jump to end of file

This can be an X app or CLI, however, I think CLI might be better, as
sometimes an emerge breaks things so X/KDE/Gnome/Etc won't start.

D.Vin

"You had me at EHLO" --E.Webb (10.04.05) 

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] OT: need text viewer with delete and multiple files
  2005-12-13  1:52 [gentoo-user] OT: need text viewer with delete and multiple files Daevid Vincent
@ 2005-12-13  4:15 ` Richard Fish
  2005-12-13  5:36 ` Willie Wong
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Richard Fish @ 2005-12-13  4:15 UTC (permalink / raw
  To: gentoo-user

On 12/12/05, Daevid Vincent <daevid@daevid.com> wrote:
> 'less /var/log/portage-logs/*' has most of these features, but it is sadly
> missing the delete mode (at least I don't know it).

for x in /var/log/portage-logs/*; do
    less $x
    rm -i $x
done

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] OT: need text viewer with delete and multiple files
  2005-12-13  1:52 [gentoo-user] OT: need text viewer with delete and multiple files Daevid Vincent
  2005-12-13  4:15 ` Richard Fish
@ 2005-12-13  5:36 ` Willie Wong
  2005-12-13  9:10 ` Neil Bothwick
  2005-12-13 19:15 ` Ben
  3 siblings, 0 replies; 8+ messages in thread
From: Willie Wong @ 2005-12-13  5:36 UTC (permalink / raw
  To: gentoo-user

On Mon, Dec 12, 2005 at 05:52:56PM -0800, Penguin Lover Daevid Vincent squawked:
> Is there any recommended text viewer/editor whereby I can easily step
> through the files (previous/next file), read .gz files, jump to the end of a
> file, and most importantly, delete the current file?

Perhaps less with the LESSOPEN and LESSCLOSE environmental variables
set? Try this:

put the following in /root/portlogclose.sh

contents of /root/portlogclose.sh
---------------------------------
#! /bin/sh
rm -i $2
---------------------------------

chmod that 700

and do the following:

 # LESSOPEN="echo %s" LESSCLOSE="/root/portlogclose.sh %s %s" less /var/log/portage/*

It should prompt you everytime you move between files whether you want
the current file deleted or not. Just type Y or N and enter. The keys
won't echo onto the screen. 

W
-- 
Faye:     You almost had a date! But you got dumped at the last minute
    in favor of an epiphany.
Sortir en Pantoufles: up 30 days, 21:54
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] OT: need text viewer with delete and multiple files
  2005-12-13  1:52 [gentoo-user] OT: need text viewer with delete and multiple files Daevid Vincent
  2005-12-13  4:15 ` Richard Fish
  2005-12-13  5:36 ` Willie Wong
@ 2005-12-13  9:10 ` Neil Bothwick
  2005-12-14  5:27   ` Daevid Vincent
  2005-12-13 19:15 ` Ben
  3 siblings, 1 reply; 8+ messages in thread
From: Neil Bothwick @ 2005-12-13  9:10 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

On Mon, 12 Dec 2005 17:52:56 -0800, Daevid Vincent wrote:

> Is there any recommended text viewer/editor whereby I can easily step
> through the files (previous/next file), read .gz files, jump to the end
> of a file, and most importantly, delete the current file?

sys-apps/most started with +d.


-- 
Neil Bothwick

Famed tautologist dies of suicide in distressing tragedy

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] OT: need text viewer with delete and multiple files
  2005-12-13  1:52 [gentoo-user] OT: need text viewer with delete and multiple files Daevid Vincent
                   ` (2 preceding siblings ...)
  2005-12-13  9:10 ` Neil Bothwick
@ 2005-12-13 19:15 ` Ben
  2005-12-13 20:22   ` Manuel McLure
  3 siblings, 1 reply; 8+ messages in thread
From: Ben @ 2005-12-13 19:15 UTC (permalink / raw
  To: gentoo-user

On Tuesday 13 December 2005 01:52, Daevid Vincent wrote:

> Is there any recommended text viewer/editor whereby I can easily step
> through the files (previous/next file), read .gz files, jump to the end of
> a file, and most importantly, delete the current file?

vim.  There's probably other (better) ways, but:

:!rm $filename
:n!

The first line tells vim to execute the shell command rm, you have to give it 
the filename, but that's displayed in the buffer anyway (or you can get it 
with ^G).  The second line tells vim to move to the next file, but to ignore 
the fact that you have a buffer opened that hasn't been written yet. :p goes 
to the previous file, if you haven't deleted it.

Actually thinking about it, you can do the same thing with less - !rm 
$filename works too.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] OT: need text viewer with delete and multiple files
  2005-12-13 19:15 ` Ben
@ 2005-12-13 20:22   ` Manuel McLure
  2005-12-13 20:39     ` Ben
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel McLure @ 2005-12-13 20:22 UTC (permalink / raw
  To: gentoo-user

Ben wrote:
> vim.  There's probably other (better) ways, but:
> 
> :!rm $filename
> :n!
> 
> The first line tells vim to execute the shell command rm, you have to give it 
> the filename, but that's displayed in the buffer anyway (or you can get it 
> with ^G).

Try:

:!rm %

"%" in a shell escape gets replaced with the name of the current file.

-- 
Manuel A. McLure KE6TAW <manuel@mclure.org> <http://www.mclure.org>
...for in Ulthar, according to an ancient and significant law,
no man may kill a cat.                       -- H.P. Lovecraft
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] OT: need text viewer with delete and multiple files
  2005-12-13 20:22   ` Manuel McLure
@ 2005-12-13 20:39     ` Ben
  0 siblings, 0 replies; 8+ messages in thread
From: Ben @ 2005-12-13 20:39 UTC (permalink / raw
  To: gentoo-user

On Tuesday 13 December 2005 20:22, Manuel McLure wrote:
> Ben wrote:
> > vim.  There's probably other (better) ways, but:
> > :!rm $filename
> > :n!
> >
> > The first line tells vim to execute the shell command rm, you have to
> > give it the filename, but that's displayed in the buffer anyway (or you
> > can get it with ^G).
>
> Try:
> :!rm %
>
> "%" in a shell escape gets replaced with the name of the current file.

I knew there'd be some way of getting that, but I couldn't find it, thanks.  
Works with both vim and less too.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [gentoo-user] OT: need text viewer with delete and multiple files
  2005-12-13  9:10 ` Neil Bothwick
@ 2005-12-14  5:27   ` Daevid Vincent
  0 siblings, 0 replies; 8+ messages in thread
From: Daevid Vincent @ 2005-12-14  5:27 UTC (permalink / raw
  To: gentoo-user

> > Is there any recommended text viewer/editor whereby I can 
> easily step
> > through the files (previous/next file), read .gz files, 
> jump to the end
> > of a file, and most importantly, delete the current file?
> 
> sys-apps/most started with +d.

This looks interesting. A couple issues I notice..

Many of the logs use ANSI escapes, and most doesn't seem to display that,
how can I turn it on?

Is there a way to have it delete the current file and advance to the next
one?

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-12-14  5:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-13  1:52 [gentoo-user] OT: need text viewer with delete and multiple files Daevid Vincent
2005-12-13  4:15 ` Richard Fish
2005-12-13  5:36 ` Willie Wong
2005-12-13  9:10 ` Neil Bothwick
2005-12-14  5:27   ` Daevid Vincent
2005-12-13 19:15 ` Ben
2005-12-13 20:22   ` Manuel McLure
2005-12-13 20:39     ` Ben

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox