scripts/bin/autoless
Alexander Gehrke cefd40b6dc Initial commit
2019-09-30 14:49:14 +02:00

15 lines
188 B
Bash
Executable file

#!/bin/zsh
if [[ -n "$@" ]]; then
out=$(<"$@")
else
out=$(cat)
fi
((lim=$LINES-1))
numlines=$(echo $out | wc -l)
if (( $numlines > $lim ))
then
echo $out | less -R
else
echo $out
fi