本文主要是介绍CTDP linux 程序员手册 (4.9) 一个 makefile 脚本的例子,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
# 将路径 $(BINLOC)添加到 /etc/rc.d/rc.local 文件内
@PATHIN=`grep "path=" /etc/rc.d/rc.local | grep "$(BINLOC)"`; / # 查看 BINLOC 路径是否被设置在 rc.local 文件内
HEADER=""; /
if /
[ -z "$PATHIN" ]; /
then /
echo Adding $(BINLOC) to path in /etc/rc.d/rc.local; /
echo >> /etc/rc.d/rc.local; /
echo "###### Added by Print Service Install on `date` by `whoami`" >> /etc/rc.d.rc.local; /
HEADER=Y; /
echo "export PATH=/$PATH:$(BINLOC)" >> /etc/rc.d.rc.local; /
else /
echo $(BINLOC) already set in path in file /etc/rc.d/rc.local; /
fi; /
PRINTST=`grep -i "printst &" /etc/rc.d/rc.local`; / # 查看字符串 printst 是否在文件rc.local 内
if /
[ -z "$PRINTST" ]; /
then /
echo Adding printst command to /etc/rc.d/rc.local file; /
if /
[ -z "$HEADER" ]; /
then /
echo >> /etc/rc.d.rc.local; /
echo "###### Added by Print Service Install on `date` by `whoami`" >> /etc/rc.d.rc.local; /
HEADER=Y; /
fi; /
echo "printst &" >> /etc/rc.d.rc.local; /
else /
echo Already have printst command in /etc/rc.d/rc.local file; /
fi; /
if /
[ -n "$HEADER" ]; /
then /
echo "###### End of Print Service Install Section ######" >> /etc/rc.d.rc.local; /
echo >> /etc/rc.d.rc.local; /
fi;
<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
这篇关于CTDP linux 程序员手册 (4.9) 一个 makefile 脚本的例子的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!