Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 71ab44b60e
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (24 sloc) 0.768 kb
#!/bin/bash
# #
# display.lunar - functions to view files #
# #
####################################################################
# function : view_file
# usage : view_file FILENAME
# purpose : to view a file
view_file() {
debug_msg "view_file ($@)"
if [ -n "$1" ] ; then
# show a file $1
case $(file -b $1 | cut -d' ' -f1) in
bzip2) bzcat $1 | ${PAGER:-less} ;;
gzip) zcat $1 | ${PAGER:-less} ;;
XZ) xzcat $1 | ${PAGER:-less} ;;
*)
# default fallback
cat "$1" | ${PAGER:-less} ;;
esac
else
cat - | ${PAGER:-less}
fi
}
Jump to Line
Something went wrong with that request. Please try again.