非常好的10道Linux shell脚本面试题
'start')
/usr/sbin/apachectl start ;;
'stop')
/usr/sbin/apachectl stop ;;
'restart')
/usr/sbin/apachectl restart ;;
*)
echo "usage $0 start|stop|restart" ;;
esac
参考答案:
(1)程序注释
#!/bin/sh 定义实用的shell
#
# /etc/rc.d/rc.httpd 注释行,凡是以星号开始的行均为注释行。
#
# Start/stop/restart the Apache web server.
#
# To make Apache start automatically at boot, make this
# file executable: chmod 755 /etc/rc.d/rc.httpd
#
case "$1" in #case结构开始,判断“位置参数”决定执行的操作。本程序携带一个“位置参数”,即$1
'start') #若位置参数为start
/usr/sbin/apachectl start ;; #启动httpd进程
'stop') #若位置参数为stop
/usr/sbin/apachectl stop ;; #关闭httpd进程
Linux shell面试题_IT/计算机_专业资料。网上整理的Linux shell脚本面试题,非常有用一道腾讯面试题: 一个文本类型的文件, 里面每行存放一个登陆者的 IP (某些...
linux shell脚本面试题 7页 2下载券 编程面试题全集 17页 免费 25道shell...在根目录下创建四个文件m1.txt,m2.txt, m3.txt,m4.txt,用Shell编程,实现...
shell面试题1 5页 1下载券 Linux shell面试题 9页 1下载券 shell编程面试题 16页 免费 linux shell脚本面试题 7页 2下载券 25道shell面试题 5页 1下载券...
shell脚本小练习_教学反思/汇报_教学研究_教育专区。今日推荐 89份文档 ... shell脚本练习题 21页 免费 Linux shell面试题 9页 1下载券 shell编程面试题...
Linux 面试题之 shell 编程详解(一)分类: Linux2009-02-20 20:32 3586 人阅读 评论(1) 收藏 举报 shell 面试编程 linux 脚本测试 测试空间旗下大头针出品 用...
25道shell面试题_自我管理与提升_求职/职场_实用文档。1、 用 sed 修改 ... linux shell脚本面试题 7页 2下载券 shell编程面试题 16页 免费 Shell 编程...
linux shell脚本面试题 7页 2下载券 shell编程面试题 16页 免费 25道shell...{i%%.*}.bak;done 1. 用 Shell 编程,判断一文件是不是块或字符设备文件,...
linux面试题_IT/计算机_专业资料。linux面试题,比较全,作完,找工作绝对没有...13.编写个shell脚本将当前目录下大于10K的文件转移到/tmp目录下 #/bin/sh #...
linux面试题二 选择题 1.关闭linux系统(不重新启动)可使用命令 B 。 A Ctrl...A 用户代理 B 代理服务器 C 传输代理 D 投递代理 40.在Shell脚本中,用来...
Linux 运维工程师面试题 一、有文件 file1 1、请用 shell 查询 file1 里面...在监控机上编写脚本,一旦某台被监控机器/ 分区适用率大于 80%, 就发邮件报警...
热门文档