#!/bin/bash
#
for i in $(ls /etc/rc.d/rc3.d/ | grep  "\<K");do
    echo $i.stop
    let sum1+=1
done

for j in $(ls /etc/rc.d/rc3.d/ | grep "\<S");do
    echo $j.start
    let sum2+=1
done

echo "There are $sum1 file names start with "K"."
echo "There are $sum2 file names start with "S"."

  1. #!/bin/bash 


  2. # 


  3. for i in $(ls /etc/rc.d/rc3.d/ | grep  "\<K");do 


  4. echo $i.stop 


  5. let sum1+=1 


  6. done 


  7.  


  8. for j in $(ls /etc/rc.d/rc3.d/ | grep "\<S");do 


  9. echo $j.start 


  10. let sum2+=1 


  11. done 


  12.  


  13. echo "There are $sum1 file names start with "K"." 


  14. echo "There are $sum2 file names start with "S"." 

原创文章,作者:N24_lantian,如若转载,请注明出处:http://www.178linux.com/63988

(0)
N24_lantianN24_lantian
上一篇 2016-12-26
下一篇 2016-12-26

相关推荐

  • CentOS启动流程排错

    grub legacy CentOS 6启动流程: POST –> Boot Sequence(BIOS) –> Boot Loader –> Kernel(ramdisk) –> rootfs –> switchroot –> /sbin/init …

    Linux干货 2016-09-13
  • bash特性

    2018-03-11

    2018-03-11
  • zabbix部署(Linux上部署/监控端/被监控端)

    zabbix部署 一、监控系统的简单介绍 (1)cacti:存储数据能力强,报警性能差 (2)nagios:报警性能差,存储数据仅有简单的一段可以判断是否在合理范围内的数据长度,储存在内存中。比如,连续采样数据存储,有连续三次不在合理范围内的数据就报警 (3)zabbix:结合上面两种工具的优点,又可以存储数据,又可以报警 二、zabbix特性 (1)数据采…

    Linux干货 2017-01-06
  • 简单救援模式应用

                                  …

    2017-08-12
  • 常见RAID级别

    什么是RAID?     独立磁盘冗余阵列(RAID,Redundant Arrary of Independent Disks),旧称廉价磁盘冗余阵列(Redundant Arrary of Inexpensive Disks),简称磁盘阵列。基本思想就是把多个相对便宜的硬盘组合起来,成为一个硬盘阵列组,使性能达到甚至超过一个价格昂贵、…

    Linux干货 2016-05-29
  • M20 – 1- 第二周博客(2):Linux的常用命令与通配符

    1、Linux的常用命令 pwd 命令 简介: Print the name of the current working directory. 格式: pwd [-LP] 实例1 [root@centos6 local]# pwd  &n…

    Linux干货 2016-08-03