Kommentare zu: my package of the day: less (yes, less) http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/ Thu, 22 Oct 2015 22:23:33 +0000 hourly 1 https://wordpress.org/?v=4.4.1 Von: Joachim Nilsson http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/comment-page-1/#comment-1035 Thu, 05 Jun 2008 20:49:42 +0000 http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/#comment-1035 I see it too, I just tried implementing my own tip on a new machine – failed miserably. Sorry about that.

The trick seems to be the citation („) and double dash’s (–) that get screwed up when I paste from Firefox into a gnome-terminal. In particular the –color (double dashes) got messed up.

That and the fact that not all installations have the following environment variables set. Ubuntu 8.04 and 7.10 seem to though.

setenv LESSOPEN ‚| /usr/bin/lesspipe %s‘
setenv LESSCLOSE ‚/usr/bin/lesspipe %s %s

I just made a quick search for it and found a better example:

http://www.speedblue.org/less_color.php

Regards
/Joachim

]]>
Von: Internet Alchemy » links for 2008-06-03 http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/comment-page-1/#comment-1006 Tue, 03 Jun 2008 23:37:03 +0000 http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/#comment-1006 […] less Some lesser(!) known options for less (tags: less howto tips linux) […]

]]>
Von: ccm http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/comment-page-1/#comment-1002 Tue, 03 Jun 2008 14:31:46 +0000 http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/#comment-1002 @Joachim: Thank you for the hint. Seems there are some details missing but I’ll figure out and probably report back.

@mish: Yes, I know most. The point is that less is installed by default on a lot of distributions. Therefore knowing it a bit deeper helps you on those systems where you either are not able to install software or just don’t want to. Nevertheless, thank you for the hint on using it as a man pager – I’ll give it a try and see how it differs.

]]>
Von: mish http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/comment-page-1/#comment-1001 Tue, 03 Jun 2008 14:25:20 +0000 http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/#comment-1001 Have you tried out most ? It can do that bit more than less.

http://debaday.livejournal.com/24084.html
http://linux.die.net/man/1/most

It’s particularly good when used by man, for which you need to do one of

update-alternatives –set pager /usr/bin/most
OR
in your .bashrc:
export PAGER=/usr/bin/most

]]>
Von: Joachim Nilsson http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/comment-page-1/#comment-1000 Tue, 03 Jun 2008 09:59:28 +0000 http://www.screenage.de/blog/2008/06/03/my-package-of-the-day-less-yes-less-2/#comment-1000 I also use less extensively and have found the .lessfilter file to be a gold mine.

Put the following in your ~/.lessfilter file:

#!/bin/sh
# Neat less trickery
# Joachim Nilsson

case „$1″ in
*.Z) uncompress –
if [ -s /tmp/less.$$ ]; then
echo /tmp/less.$$
else
rm -f /tmp/less.$$
fi
;;
*.[ch]) export LESS=“$LESS -R“; enscript -Ec –color -w ansi -o – $1
;;
esac

Now, run „less -r myfile.c“ and have syntax highlighted C, thanks to enscript!

I should blog about these things, I do it too rarely. :-)

]]>