shell中标题打印
#!/bin/bash
function title_print ()
{
terminal_width=$(stty size|cut -d' ' -f2)
title=$1
title_length=$(echo $title|wc -L)
pre_length=$[($terminal_width-$title_length)/2 - 1]
yes "#" | sed $pre_length'q' | tr -d '\n'
echo -n " "$title" "
yes "#" | sed $pre_length'q' | tr -d '\n'
echo ''
}
# title_print "I am title"