#!/usr/bin/env bash # https://brettterpstra.com/2016/04/27/shell-tricks-shorten-every-line-of-output/ #TODO allow different width to be set c=$(tput cols) w=$((c - 1)) cat | sed -E "s/(.{$w}).*$/\1…/"