#!/usr/bin/env bash COLUMNS=${COLUMNS:-$(tput cols)} awk -vL=${1:-$COLUMNS} '{e=length>L?"…":"";print substr($0,0,L-(e?1:0)) e}'