[瞎搞] 奇怪的登陆问候(污!

嘛效果如图,其实也不是我第一个想到的,之前在推特上看到了有人这么做,我也就试了一下……

QQ截图20151013145715
下面放代码,本人没学过shell脚本,写的比较垃圾,大触看到后求不喷(

#! /bin/bash

print() {
        STR=$1
        ROW=$2
        LEN=`echo $STR | wc -c`
        COLS=`tput cols`
        HOLD_COL=`expr $COLS - $LEN`
        NEW_COL=`expr $HOLD_COL / 2`
        tput cup $ROW $NEW_COL
        echo -e $STR
}

clear
echo ""
_STR=" FBI WARNING "
_ROW=2
LEN=`echo $_STR | wc -c`
COLS=`tput cols`
HOLD_COL=`expr $COLS - $LEN`
NEW_COL=`expr $HOLD_COL / 2`
tput cup $_ROW $NEW_COL
echo -e "\e[41m FBI WARNING \e[40m "

print "Federal law provides severe civil and criminal penalties for " 4
print "the unauthorized reproduction,distribution,or exhibition of" 5
print "copyrighted motion prictures(Title 17, United States Code," 6
print "Sections 501 and 508). The federal bureau of Investigation" 7
print "investigate allegations of criminal copyright infringement." 8
print "(Title 17, United States Code, Section 506)" 9
echo ""
echo ""
exit 0