home | list info | list archive | date index | thread index

[OCLUG-Tech] least: bash pager hack

Hi all,

I wanted to have a pager that would decide if the text was being worth
paged.  That is a pager that behaved like cat if the text would fit on
the screen, and would behave like less if the text would not fit on the
screen.

Here is my attempt:

http://www.jukie.net/~bart/scripts/least/bashrc.least

This is the first time I've used bash arrays, and am not a huge fan. :)

Can any of you bash gurus find a way to shorten the code?

I would hope that there is a way to rewrite the dump_array() helper
function in a one liner -- like perl's join function.

Cheers,
Bart

-- 
				WebSig: http://www.jukie.net/~bart/sig/

Attachment: signature.asc
Description: Digital signature