§A»Ýn§i¶D§Aªº²×ºÝ¾÷ÅX°Êµ{¦¡§A·Qnªº¥t¤@Ó¹w³]È¡Cn¦p¦ó§@¨Ã¨S¦³¤@ӼзǪº¤èªk¡A¤£¹L¦pªG§A¬O¥Î Linux ªº¸Ü¡A§A¦³ setterm ³oÓµ{¦¡¥i¥H¥Î¡C
"setterm" ¨Ï¥Î²×ºÝ¾÷¸ê®Æ®wùتº¸ê®Æ¨Ó³]©wÄÝ©Ê¡Cn¿ï¾ÜÄݩʪº¸Ün³o¼Ë§@
setterm -foreground black -background white -store
"-store" °Ñ¼Æ§â²{¦b©Ò§@ªº§ïÅܳ]©w¦¨¹w³]È¡C³o»Ýn§A²{¦b¨Ï¥Îªºªº²×ºÝ¾÷ºØÃþ(¦b TERM Àô¹ÒÅܼÆùØ)¦b termcap ¸ê®Æ®wùئ³¨¬°÷¸Ô²Óªº¬ö¿ý¡C¦pªG setterm ¦]¬°¬YºØ¦]¯À¤£¯à¥¿±`ªº¤u§@¡A§AÁÙ¦³¨ä¥¦ªº¿ï¾Ü¡C
§An¦³¦Ü¤Ö¤@ºØ¤U¦Cªº xterm¡A¦Ó¥Bn¤ä´©±m¦â¡C
xterm -fg white -bg blue4
color_xterm -fg white -bg blue4
color-xterm -fg white -bg blue4
nxterm -fg white -bg blue4
³oùتº 'color_xterm' ¤ä´©±m¦âª©ªº 'ls'¡C³oùتºÃC¦â¿ï¾Ü¬O¼Ò§Ï SGI ¤W±¨Ï¥ÎªºÃC¦â¡C
§A¤]¥i¥Hקï®Ö¤ß¡A³o¼Ë´N¥i¥H¤@³Ò¥Ã¶hªº¥Î±±¨î½X¨Ó§ïÅܵêÀÀ¥D±±¥xªº¹w³]È¡C¦pªG§A¦Û¤v½sĶ®Ö¤ßªº¸Ü¡A§Ú«Øij§Q¥Î kernel ªººó¸ÉÀÉ¡C
®Ö¤ßªºì©l½X¬O¦b /usr/src/linux/drivers/char/console.c
¡A¤j·§¦b 1940 ¦æ¡A³o¬O§AÀ³¸Óק諸¦a¤è
def_color = 0x07; /* white */
ulcolor = 0x0f; /* bold white */
halfcolor = 0x08; /* grey */
def_color = 0x17; /* white */
ulcolor = 0x1f; /* bold white */
halfcolor = 0x18; /* grey */
³oÃ䪺¤Q¤»¶i¦ì¼Æ¦r¬Oµ¹Åã¥Ü¥d¥Îªº: ³Ì¥ªÃ䪺¦ì¤¸(¤W±½d¨Òªº "1")¬OI´º ; ³Ì¥kÃ䪺¦ì¤¸¬O«e´º¡C0 = ¶Â¦â¡A1 = ÂŦâ¡A2 = ºñ¦â¡A3 = «C¦â, 4 = ¬õ¦â, 5 = µµ¦â¡A6 = ´Ä¦â/¶À¦â¡A7 = ¥Õ¦â¡C§â¼Æ¦r¥[ 8 ¥i¥H±o¨ì°ª«G«×ªºÃC¦â¡C¦b¤j³¡¥÷ªº±¡ªp¤U¡A°ª«G«×ªºI´º¦â == °{Ã{ªº¦r¥[¤W´¶³qªºI´º¡C ¥Ñ sjlam1@mda023.cc.monash.edu.au ©Ò´£¨Ñ
§A¤]¥i¥H¨Ï¥Î¤U±ªº ANSI ±±¨î½X´£¨Ñ¤@Ó°õ¦æ®É´Áªº¥D±±¥x¹w³]È¡C(¦b®Ö¤ßì©l½Xùاä¨ìªº)
ESC [ 8 ]
³oÓ±±¨î½X§â¹w³]ȳ]¦¨¥Ø«eªº«e´º¤ÎI´ºÃC¦â¡CµM«á«³]Äݩʪº±±¨î½X(ESC [ m)Åý³o¹w³]È°¨¤W´N¨ú¥N¶Â¥Õ¦â¦¨¬°¨Ï¥Î¤¤ªºÃC¦â¡C
¨C¦¸§A«¶}¾÷ªº®É«J§A³£»Ýn¦A§â³o¨Ç¦r¦ê°eµ¹¥D±±¥x¡C¨Ì·Ó§Aªº Linux ¥D¾÷¥Î³~¤£¦P¡A¦³¦n´XÓÀÉ®×¥i¥H¹F¦¨³oӥتº¡C
¦b Slackware ùسo´N¬O "Welcome to Linux xx.yy" °T®§©Ò¦bªºÀɮסA¦pªG§Aªº¥D¾÷¬OÓ¤H¨Ï¥Îªº¸Ü¡A±q³oÓÀɮפU¤â¬O¤£¿ùªº¿ï¾Ü(¦ý¹ï©ó¥Î telnet »·ºÝµn¤J¨Ï¥Î¨t²Îªº¤H´N¥i¯à¦³ÂI°Q¹½)¡C ³oÓÀɮצb¨C¦¸¶}¾÷ªº®É«J³£·|³Q»s³y¥X¨Ó¡Aì¨Óªº¤º®e«h³QÂл\¡A©Ò¥H§A¥²»Ýnקï¶}¾÷ÀÉ®×(¦b Slackware ùجO /etc/rc.d/rc.S¡ARedhatùجO /etc/rc.d/rc.local)ùرªº¤U¦C´X¦æ:
echo ""> /etc/issue
echo Welcome to Linux `/bin/uname -a | /bin/cut -d\ -f3`. >> /etc/issue
§ï¦¨
ESCAPE="¦b³oùØ©ñ¤J ESC ½X"
echo "${ESCAPE}[H${ESCAPE}[37;44m${ESCAPE}[8]${ESCAPE}[2J"> /etc/issue
echo Welcome to Linux `/bin/uname -a | /bin/cut -d\ -f3`. >> /etc/issue
³oùتº±±¨î½X·|§â¹C¼ÐÂk¦ì¡B³]©wÃC¦â(¦b³oùتº«e´º¬O¥Õ¦â¦ÓI´º¬OÂŦâ)¡B§â³oÓ³]©w¦s°_¨Ó¨Ã¥B§â¿Ã¹õ¤W¨ä¥¦³¡¥÷²M°£±¼¡C
³oùتº§ïÅÜ·|¦b¤U¦¸«¶}¾÷®É¥Í®Ä¡C§O§Ñ¤F¦b emacs n¥´¤J ESC ¦r¤¸n«ö C-q Áä¦Ó¦b vi ùØn«ö control-v¡A¦]¬°«ÜÅãµMªº°õ¦æ¥H¤Wµ{¦¡ªº sh ¨Ã¤£¤F¸Ñ /033
³oºØ¥Îªk¡C
if [ "$TERM" = "console" ]; then
echo "\033[37;44m\033[8]" #
# ©Î¨Ï¥Î setterm¡C
setterm -foreground white -background blue -store
fi
if ( "$TERM" == "console" ) then
echo "\033[37;44m\033[8]"
# ©Î¨Ï¥Î setterm¡C
setterm -foreground white -background blue -store
endif
[ ĶªÌª`: Linux ªº¥D±±¥x¤Uªº $TERM Àô¹ÒÅܼƤw¸g¬O "linux" ¦Ó¤£¬O "console" ¤F ]
§AÀ³¸Ó¥i¥H¥Î¤W±¥Ü½d¹Lªº setterm µ{¦¡¡C·íµM¡A»·ºÝªº¾÷¾¹¥²»Ýn¯à°÷±o¨ì¨¬°÷ªº¸ê°T¨Ó¾Þ§@§Aªº²×ºÝ¾÷¡A¦Ó¥B§Aªº²×ºÝ¾÷¼ÒÀÀµ{¦¡n¯à°÷¤ä´©±m¦â¡C ¦b§Úªº¸gÅçùب䥦¥¥x¤W³Ì¦nªº vt100 ²×ºÝ¾÷¼ÒÀÀµ{¦¡¦³¤U¦C´XºØ:
Ãö©ó kermit ªº²Ó¸`½Ð¬Ý http://www.columbia.edu/kermit/