diff options
Diffstat (limited to 'lk.sh')
| -rwxr-xr-x | lk.sh | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -1,28 +0,0 @@ -#!/bin/bash - -# This is helper that should replace a number of common commands -# -# It is intended to be named `lk`, short for "look" - -longView=${PAGER:-$(which less || which more || echo "cat")} -dirView="ls --color=auto -Alh" - -if [ $# -lt 1 ]; then - # take stdin instead - $dirView $(pwd) -fi - -for a in $@; do - if [ $a == "" ]; then - echo "Empty argument skipped" - elif [ ! -e $a ]; then - echo "$a does not exist" 1>&2 - exit -1 - elif [ -d $a ]; then - $dirView $a - elif [ $(tput lines) -ge $(($(wc -l < $a) - 2)) ]; then - cat $a - else - ${longView} $a - fi -done |
