This runs as expected in an xterm:
sha512sum <filename> | cut -c -$COLUMNS, but not within a
#! /bin/bash script such as
dothis.sh <args>, because
$COLUMNS is not known, so to say.
I'd rather not pass $COLUMNS as an argument, nor export it to the environment.
The script is not critical, needs to run only on one machine, on a commandline in an xterm.
Linux pre 3.2.0-4-amd64 #1 SMP Debian 3.2.81-2 x86_64 GNU/Linux GNU bash, version 4.2.37 XTerm(278)