Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/smshex_r.../proc/self/root/bin
File: lesspipe.sh
#!/bin/sh
[0] Fix | Delete
#
[1] Fix | Delete
# To use this filter with less, define LESSOPEN:
[2] Fix | Delete
# export LESSOPEN="|/usr/bin/lesspipe.sh %s"
[3] Fix | Delete
#
[4] Fix | Delete
# The script should return zero if the output was valid and non-zero
[5] Fix | Delete
# otherwise, so less could detect even a valid empty output
[6] Fix | Delete
# (for example while uncompressing gzipped empty file).
[7] Fix | Delete
# For backward-compatibility, this is not required by default. To turn
[8] Fix | Delete
# this functionality there should be another vertical bar (|) straight
[9] Fix | Delete
# after the first one in the LESSOPEN environment variable:
[10] Fix | Delete
# export LESSOPEN="||/usr/bin/lesspipe.sh %s"
[11] Fix | Delete
[12] Fix | Delete
if [ ! -e "$1" ] ; then
[13] Fix | Delete
exit 1
[14] Fix | Delete
fi
[15] Fix | Delete
[16] Fix | Delete
if [ -d "$1" ] ; then
[17] Fix | Delete
ls -alF -- "$1"
[18] Fix | Delete
exit $?
[19] Fix | Delete
fi
[20] Fix | Delete
[21] Fix | Delete
exec 2>/dev/null
[22] Fix | Delete
[23] Fix | Delete
# Allow for user defined filters
[24] Fix | Delete
if [ -x ~/.lessfilter ]; then
[25] Fix | Delete
~/.lessfilter "$1"
[26] Fix | Delete
if [ $? -eq 0 ]; then
[27] Fix | Delete
exit 0
[28] Fix | Delete
fi
[29] Fix | Delete
fi
[30] Fix | Delete
[31] Fix | Delete
manfilter ()
[32] Fix | Delete
{
[33] Fix | Delete
if test -x /usr/bin/man ; then
[34] Fix | Delete
# See rhbz#1241543 for more info. Well, actually we firstly
[35] Fix | Delete
# used 'man -l', then we switched to groff, and then we again
[36] Fix | Delete
# switched back to 'man -l'.
[37] Fix | Delete
/usr/bin/man -P /usr/bin/cat -l "$1"
[38] Fix | Delete
elif test -x /usr/bin/groff; then
[39] Fix | Delete
# This is from pre-rhbz#1241543-time.
[40] Fix | Delete
groff -Tascii -mandoc "$1" | cat -s
[41] Fix | Delete
else
[42] Fix | Delete
echo "WARNING:"
[43] Fix | Delete
echo "WARNING: to better show manual pages, install 'man-db' package"
[44] Fix | Delete
echo "WARNING:"
[45] Fix | Delete
cat "$1"
[46] Fix | Delete
fi
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
export MAN_KEEP_FORMATTING=1
[50] Fix | Delete
[51] Fix | Delete
case "$1" in
[52] Fix | Delete
*.[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)
[53] Fix | Delete
case "$1" in
[54] Fix | Delete
*.gz) DECOMPRESSOR="gzip -dc" ;;
[55] Fix | Delete
*.bz2) DECOMPRESSOR="bzip2 -dc" ;;
[56] Fix | Delete
*.xz|*.lzma) DECOMPRESSOR="xz -dc" ;;
[57] Fix | Delete
esac
[58] Fix | Delete
if [ -n "$DECOMPRESSOR" ] && $DECOMPRESSOR -- "$1" | file - | grep -q troff; then
[59] Fix | Delete
$DECOMPRESSOR -- "$1" | manfilter -
[60] Fix | Delete
exit $?
[61] Fix | Delete
fi ;;&
[62] Fix | Delete
*.[1-9n]|*.[1-9]x|*.man)
[63] Fix | Delete
if file "$1" | grep -q troff; then
[64] Fix | Delete
manfilter "$1"
[65] Fix | Delete
exit $?
[66] Fix | Delete
fi ;;&
[67] Fix | Delete
*.tar) tar tvvf "$1"; exit $? ;;
[68] Fix | Delete
*.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1"; exit $? ;;
[69] Fix | Delete
*.tar.xz) tar Jtvvf "$1"; exit $? ;;
[70] Fix | Delete
*.xz|*.lzma) xz -dc -- "$1"; exit $? ;;
[71] Fix | Delete
*.tar.bz2|*.tbz2) bzip2 -dc -- "$1" | tar tvvf -; exit $? ;;
[72] Fix | Delete
*.[zZ]|*.gz) gzip -dc -- "$1"; exit $? ;;
[73] Fix | Delete
*.bz2) bzip2 -dc -- "$1"; exit $? ;;
[74] Fix | Delete
*.zip|*.jar|*.nbm) zipinfo -- "$1"; exit $? ;;
[75] Fix | Delete
# --nomanifest -> rhbz#1450277
[76] Fix | Delete
*.rpm) rpm -qpivl --changelog --nomanifest -- "$1"; exit $? ;;
[77] Fix | Delete
*.cpi|*.cpio) cpio -itv < "$1"; exit $? ;;
[78] Fix | Delete
*.gpg)
[79] Fix | Delete
if [ -x /usr/bin/gpg2 ]; then
[80] Fix | Delete
gpg2 -d "$1"
[81] Fix | Delete
exit $?
[82] Fix | Delete
elif [ -x /usr/bin/gpg ]; then
[83] Fix | Delete
gpg -d "$1"
[84] Fix | Delete
exit $?
[85] Fix | Delete
else
[86] Fix | Delete
echo "No GnuPG available."
[87] Fix | Delete
echo "Install gnupg2 or gnupg to show encrypted files."
[88] Fix | Delete
exit 1
[89] Fix | Delete
fi ;;
[90] Fix | Delete
*.gif|*.jpeg|*.jpg|*.pcd|*.png|*.tga|*.tiff|*.tif)
[91] Fix | Delete
if [ -x /usr/bin/identify ]; then
[92] Fix | Delete
identify "$1"
[93] Fix | Delete
exit $?
[94] Fix | Delete
elif [ -x /usr/bin/gm ]; then
[95] Fix | Delete
gm identify "$1"
[96] Fix | Delete
exit $?
[97] Fix | Delete
else
[98] Fix | Delete
echo "No identify available"
[99] Fix | Delete
echo "Install ImageMagick or GraphicsMagick to browse images"
[100] Fix | Delete
exit 1
[101] Fix | Delete
fi ;;
[102] Fix | Delete
*)
[103] Fix | Delete
if [ -x /usr/bin/file ] && [ -x /usr/bin/iconv ] && [ -x /usr/bin/cut ]; then
[104] Fix | Delete
case `file -b "$1"` in
[105] Fix | Delete
*UTF-16*) conv='UTF-16' ;;
[106] Fix | Delete
*UTF-32*) conv='UTF-32' ;;
[107] Fix | Delete
esac
[108] Fix | Delete
if [ -n "$conv" ]; then
[109] Fix | Delete
env=`echo $LANG | cut -d. -f2`
[110] Fix | Delete
if [ -n "$env" -a "$conv" != "$env" ]; then
[111] Fix | Delete
iconv -f $conv -t $env "$1"
[112] Fix | Delete
exit $?
[113] Fix | Delete
fi
[114] Fix | Delete
fi
[115] Fix | Delete
fi
[116] Fix | Delete
exit 1
[117] Fix | Delete
esac
[118] Fix | Delete
[119] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function