#!/bin/sh # 查找最后一行FontPath的行数 LINENO=`sed -n '/FontPath/=' /etc/X11/xorg.conf | sed -n '$p'` # 在最后一行FontPath之后附加字体路径/usr/share/fonts/ttf/zh_CN sed "${LINENO}a\ FontPath \"/usr/share/fonts/ttf/zh_CN/\"" /etc/X11/xorg.conf > /etc/X11/xorg.conf.bak mv /etc/X11/xorg.conf.bak /etc/X11/xorg.conf