From: Dave Thomas Date: 2003-12-18T04:48:06+09:00 Subject: Re: paging (was Newbie questions) On Dec 17, 2003, at 13:25, Thomas Adam wrote: > >> Interesting. So there's apparantly no consistant way of finding a >> pager >> program. > It would be easy to do... > Test for either: > $PAGER > and the like... > if they're defined use them, otherwise default to a generic one. Here's the code I'm using in 'ri'. Will it work across the systems that folks use? for pager in [ ENV['pager'], "less", "more <" ].compact.uniq if system("#{pager} #{path}") paged = true break end end if !paged @options.use_stdout = true puts File.read(path) end Cheers Dave