bf92281784
Mon Feb 05 2001 Yukihiro Nakai <ynakai@redhat.com> - Update less.sh, less.csh to set JLESSCHARSET=japanese when LANG=ja?? Mon Feb 05 2001 Matt Wilson <msw@redhat.com> - changed the less-358+iso247-20001210.diff patch to use strcasecmp when comparing locale names Thu Feb 01 2001 Karsten Hopp <karsten@redhat.de> - fixed character translations (bugzilla #24463) Wed Jan 31 2001 Karsten Hopp <karsten@redhat.de> - fixed lesspipe (bugzilla #17456 #25324) Tue Dec 12 2000 Bernhard Rosenkraenzer <bero@redhat.com> - rebuild with new ncurses Mon Dec 11 2000 Yukihiro Nakai <ynakai@redhat.com> - Add Japanese patch with ia64 support. Mon Nov 27 2000 Karsten Hopp <karsten@redhat.de> - rebuild with new ncurses - fix Bug #21288 Mon Nov 13 2000 Karsten Hopp <karsten@redhat.de> - fixed handling of manpages of type *.1x.gz - added support for cpio packages Thu Sep 14 2000 Than Ngo <than@redhat.com> - added new lesspipe.sh (Bug #17456)
35 lines
850 B
Bash
Executable File
35 lines
850 B
Bash
Executable File
#!/bin/sh -
|
|
#
|
|
# To use this filter with less, define LESSOPEN:
|
|
# export LESSOPEN="|/usr/bin/lesspipe.sh %s"
|
|
|
|
lesspipe() {
|
|
case "$1" in
|
|
*.[1-9n]|*.man|*.[1-9n].bz2|*.man.bz2|*.[1-9].gz|*.[1-9]x.gz|*.[1-9].man.gz)
|
|
case "$1" in
|
|
*.gz) DECOMPRESSOR="gunzip -c" ;;
|
|
*.bz2) DECOMPRESSOR="bunzip2 -c" ;;
|
|
*) DECOMPRESSOR="cat" ;;
|
|
esac
|
|
if $DECOMPRESSOR -- "$1" | file - | grep -q troff; then
|
|
if echo "$1" | grep -q ^/; then #absolute path
|
|
man -- "$1" | cat -s
|
|
else
|
|
man -- "./$1" | cat -s
|
|
fi
|
|
else
|
|
$DECOMPRESSOR -- "$1"
|
|
fi ;;
|
|
*.tar) tar tvvf "$1" ;;
|
|
*.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1" ;;
|
|
*.tar.bz2|*.tbz2) tar tIvvf "$1" ;;
|
|
*.[zZ]|*.gz) gzip -dc -- "$1" ;;
|
|
*.bz2) bzip2 -dc -- "$1" ;;
|
|
*.zip) zipinfo -- "$1" ;;
|
|
*.rpm) rpm -qpivl -- "$1" ;;
|
|
*.cpi|*.cpio) cpio -itv < "$1" ;;
|
|
esac
|
|
}
|
|
|
|
lesspipe "$1" 2> /dev/null
|