Quantcast
Channel: SuSE Linux – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 217

OpenSUSE 12.2: Install package lesspipe and using it from bash

$
0
0

lesspipe is a great tool:

lesspipe.sh is an input filter for the pager less as described in less‘s man page. The script allows you to view files with binary content, compressed files, archives and files contained in archives.

… however getting it to run on OpenSUSE was a bit of a journey as it is not part of the standard OpenSUSE 12.x repository. You can only get ‘unstable’ lesspipe packages, of which the Show home:adra / lesspipe – openSUSE Build Service seems to be maintained most frequently.

This is how to install it from there:

zypper addrepo http://download.opensuse.org/repositories/home:adra/openSUSE_Factory/home:adra.repo
zypper refresh
zypper install lesspipe

I am using the bash shell, so after doing that, I had to add this line to my my ~/.bashrc

LESSOPEN="|lesspipe.sh %s"; export LESSOPEN

You can-reapply your ~/.bashrc, but note that it can give issues when appending existing environment variables like PATH. From

bash – How do I reload .bashrc without logging out and back in?:

Use the source command (or the dot shortcut .) which – depending if your .bashrc is in the current directory, can be any of these:

  • source .bashrc
  • . .bashrc
  • source ~/.bashrc
  • . ~/.bashrc

–jeroen

via:


Filed under: *nix, Linux, Power User, SuSE Linux

Viewing all articles
Browse latest Browse all 217

Trending Articles