Skip to content

Instantly share code, notes, and snippets.

@mothdotmonster
Created May 21, 2022 04:56
Show Gist options
  • Save mothdotmonster/211c372dba429963a86d26d15514e460 to your computer and use it in GitHub Desktop.
Save mothdotmonster/211c372dba429963a86d26d15514e460 to your computer and use it in GitHub Desktop.
bold half of every word in the input
#!/bin/bash
while [ "$1" != "" ]; do
printf "\033[1m%s\033[m%s " "${1:0:$(( ${#1} / 2 ))}" "${1:$(( ${#1} / 2 ))}"
shift 1
done
printf "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment