BashBox

The code:

#/bin/bash

bashBox () {
    str="$@"
    len=$((${#str}+4))
    for i in $(seq $len); do echo -n "*"; done;
    echo; echo "* "$str" *";
    for i in $(seq $len); do echo -n "*"; done;
    echo
}

bashBox "Yea, a bash Box"

The output:

% ./bashbox.sh 
*******************
* Yea, a bash Box *
*******************

Posted

May 19, 2009, 5:02 pm

Tags

, ,

More

Permalink

Comments

Send your comment by mail.