Created
September 27, 2015 22:00
-
-
Save amitizle/29e32f677456083275e0 to your computer and use it in GitHub Desktop.
Print title in bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Usage: print_title word1 word2 .. wordn | |
title=${*:1} | |
title_size=${#title} | |
output_line_size=$(echo "$title_size + 4" | bc -l) | |
eval printf '=%.0s' {1..$output_line_size} | |
printf "\n" | |
printf "= $title =" | |
printf "\n" | |
eval printf '=%.0s' {1..$output_line_size} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment