From 57a99e05234ffc28bb3a1d16c058bf38ce629d82 Mon Sep 17 00:00:00 2001 From: Andreas Mair Date: Thu, 26 Aug 2010 07:50:59 +0200 Subject: Merge from v1.3-devel head (Submitted by Joe_D @vdr-portal.de). --- contrib/reclist/vdr_crop_output.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 contrib/reclist/vdr_crop_output.sh (limited to 'contrib/reclist/vdr_crop_output.sh') diff --git a/contrib/reclist/vdr_crop_output.sh b/contrib/reclist/vdr_crop_output.sh new file mode 100644 index 0000000..80df4f3 --- /dev/null +++ b/contrib/reclist/vdr_crop_output.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +PRGNAME=$(basename $0) + +usage() { + echo "usage: ${PRGNAME} (all|head|tail)" +} + +what=${1} +if [[ -z ${what} ]]; then + usage + exit +fi + + + +# set values for the positions of each column and the sortpositions +. vdr_set_values_for_recording_lists.sh + + + +# crop vertically / lines +if [ "$what" == "head" ] ; then + LINEFILTER=" head -n ${LINES_PER_PAGE} |" +elif [ "$what" == "tail" ] ; then + LINEFILTER=" tail -n ${LINES_PER_PAGE} |" +else + LINEFILTER="" +fi + + +COMMAND="cat /dev/stdin | ${LINEFILTER} cut -b 1-${CHARS_PER_LINE}" +#echo "cmd: ${COMMAND}" +eval "${COMMAND}" -- cgit v1.2.3