summaryrefslogtreecommitdiff
path: root/contrib/reclist/vdr_crop_output.sh
diff options
context:
space:
mode:
authorAndreas Mair <andreas@vdr-developer.org>2010-08-26 07:50:59 +0200
committerAndreas Mair <andreas@vdr-developer.org>2010-08-26 07:57:29 +0200
commit57a99e05234ffc28bb3a1d16c058bf38ce629d82 (patch)
treefd24bf63611cfe9aad299e2cb88c1c85df950c1d /contrib/reclist/vdr_crop_output.sh
parentacf461064b16ec85ef52887773d8d6a364826106 (diff)
downloadvdr-plugin-extrecmenu-57a99e05234ffc28bb3a1d16c058bf38ce629d82.tar.gz
vdr-plugin-extrecmenu-57a99e05234ffc28bb3a1d16c058bf38ce629d82.tar.bz2
Merge from v1.3-devel head (Submitted by Joe_D @vdr-portal.de).
Diffstat (limited to 'contrib/reclist/vdr_crop_output.sh')
-rw-r--r--contrib/reclist/vdr_crop_output.sh34
1 files changed, 34 insertions, 0 deletions
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}"