Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (23 sloc) 0.726 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} ;;
*)
# default fallback
cat "$1" | ${PAGER:-less} ;;
esac
else
cat - | ${PAGER:-less}
fi
}
Jump to Line
Something went wrong with that request. Please try again.