- Clean lesspipe.sh script
This commit is contained in:
parent
50e7a8994a
commit
f9e095f461
@ -72,6 +72,7 @@ ls -la $RPM_BUILD_ROOT/etc/profile.d
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%changelog
|
||||
- Clean lesspipe.sh script
|
||||
- Split case for compressed and plain troff files
|
||||
- Add support for *.xz and *.lzma man pages
|
||||
Resolves: #676057
|
||||
|
23
lesspipe.sh
23
lesspipe.sh
@ -11,7 +11,17 @@
|
||||
# after the first one in the LESSOPEN environment variable:
|
||||
# export LESSOPEN="||/usr/bin/lesspipe.sh %s"
|
||||
|
||||
lesspipe() {
|
||||
if [ ! -e "$1" ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "$1" ] ; then
|
||||
ls -alF -- "$1"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
exec 2>/dev/null
|
||||
|
||||
case "$1" in
|
||||
*.[1-9n].bz2|*.[1-9]x.bz2|*.man.bz2|*.[1-9n].[gx]z|*.[1-9]x.[gx]z|*.man.[gx]z|*.[1-9n].lzma|*.[1-9]x.lzma|*.man.lzma)
|
||||
case "$1" in
|
||||
@ -63,15 +73,4 @@ lesspipe() {
|
||||
exit 1
|
||||
esac
|
||||
exit $?
|
||||
}
|
||||
|
||||
if [ ! -e "$1" ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "$1" ] ; then
|
||||
ls -alF -- "$1"
|
||||
exit $?
|
||||
else
|
||||
lesspipe "$1" 2> /dev/null
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user