Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 462 Bytes

draw_a_box.md

File metadata and controls

33 lines (27 loc) · 462 Bytes

Create boxed text using a bash alias

Add this to your .bashrc:

function box {
    size=${#1}
    printf '#'
    printf '=%.0s' $(seq 1 $(( ${size} + 6 )))
    printf '#\n'
    echo -n "#   "
    echo -n ${1}
    echo -n "   #"
    printf '\n'
    printf '#'
    printf '=%.0s' $(seq 1 $(( ${size} + 6 )))
    printf '#\n'
}

Run:

box this is cool

Output:

#==================#
#   this is cool   #
#==================#