A collection of shell scripts to make my live easier.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
192 B

function truncate() {
[[ $# -lt 2 ]] && return 1
local STRING=$1
[[ ${#STRING} -gt ${2} ]] && STRING="${STRING:0:$(($2-3))}..."
echo -n ${STRING}
}
# vim: set et ts=4 sw=4: