shell脚本1

 

信息同步:

一、常用的liunx命令选项

    -a  显示所有对象
    -c 生成一个计数
    -d 指定一个目录
    -e 扩展一个目录
    -f  指定读入数据的文件
    -h 显示命令帮助的信息
    -i 忽略文本大小写
    -l 产生输出的长格式版本
    -n 使用非交互模式(批处理)
    -o 将所有输出重定向到的指定的输出文件
    -q 以安静模式运行
    -r 递归的处理目录和文件
    -s以安静模式运行
        子主题 1
    -v  生成详细输出
    -x 排除某个对象
    -y 对所有问题回答yes
    
    
二、呈现数据

    1,Linux标准文件描述3个
        标准输入 STDIN  0
            输入重定向符号 (<)
                exec  0< testfile  ,exec命令将STDIN重定向到Linux系统中的文件
        标准输出 STDOUT  1
            输出重定向(>)
                将数据追加到某个文件(>>)
                exec   1>  testout exec 命令会启动一个新的shell并将STDOUT并将STDOUT文件描述符重定向到文件。
        标准错误 STDERR   2
            重定向错误(2>)
                exec 3> test13out,exec命令给输出分配文件描述符
                    >&3
                exec 3>> test13out
                    >&3
        当出现 (&>)所有输出发送到同一位置
        重定向
            临时重定向 (>&2)
            永久重定向(exec 2>testerr)
            
    2,记录消息
        tee  filename ,tee命令相当于管道的T型接头。它将从STDIN过来的数据同时发往两处。一处是STDOUT, 另一处是tee命令行所指定的文件名。
            tee  -a filename,将数据追加到文件中,用-a选项
            
            
三、命令汇总
    read -p "xxxx" answer
    break
    continue
    for
    if
    while
    until
    case
    
    echo
        echo -e '....\t\n... '   输出转义字符
            常用的转义字符
                \b 转义后相当于按退格键backspace,\b后要有数据
                \c 不换行输出,在\c后面不存在字符的情况下。
                \n 换行输出
                \f 或 \v 换行,但是新行的开头位置连接着上一行的行尾
                \t 转义后表示插入tab,制表符
                \r 光标移至行首,但不换行,\r以后的字符替换行首的相同数量的字符。
                \\ 表示插入本身
        echo  -n  表示不换行输出
        
        
四、控制脚本

    1,处理信号
        常用的Linux信号
            信号1,值SIGHUP,挂起进程
            信号2,值:SIGINT,终止进程
            信号3,值:SIGOUIT,停止进程
                可以中断shell,Linux内核会停止位shell分配CPU处理时间。
                    ctrl + c
            信号9,值:SIGKILL,无条件终止进程
            信号15,值:SIGTERM,尽可能终止进程
            信号17,值:SIGSTOP,无条件停止进程,但不终止进程
            信号18,值:SIGTSTP,停止或暂停进程,但不终止进程
                ctrl + z
                    停止进程会继续保留在内存中,并能从上次停止的位置继续运行。
            信号19,值:SIGCONT,继续运行停止的进程
        捕获信号
            trap命令,
                捕获脚本退出:在trap命令后加EXIT信号
                修改或移除捕获(tarp  --   信号)
            命令格式: trap   commands   signals
            
            命令格式: trap   commands   signals
            
            命令格式: trap   commands   signals
            
            命令格式: trap   commands   signals
            
    2,后台运行脚本  &
        方括号里是作业号,下一个是进程号PID
            ps
            
    3,非控制台下运行脚本
        让脚本一直以后台模式运行到结束,即使退出了终端,可以用nohup命令来实现
            nohup命令会自动将STDOUT和STDERR的消息重定向到一个名为nohup.out的文件中
            
    4,作业控制(jobs)
        jobs
        jobs -l
            列出进程的PID及作业号
        jobs -n
            只列出上次shell发出的通知后改变了状态的作业
        jobs -p
            只列出作业的PID
        jobs -r
            只列出运行中的作业
        jobs -s
            只列出已停止的作业
        带加号的是默认作业
            带减号的是下一个默认作业
            
    5,重启停止作业
        要以后台模式重启一个作业,可以用bg命令加上作业号(bg  作业号)
        要以前台模式重启作业,可以用带有作业号的fg命令(fg   作业号)
        
    6,调整谦让度
        优先级
            -20(最高优先级)
            19(最低优先级)
        nice设置命令启动时的调度优先级
            nice -n 10 ./test4.sh > test4.out &
                ps -p 8045 -o pid,ppid,ni,cmd
            -n  命令行来指定新的优先级级别
        renice想改变系统上一运行命令的优先级
            ps -p 8089 -o pid,ppid,ni,cmd
                renice -n 5 -p 8089
            指定运行进程的PID来改变它的进程
            注意:
                root用户可以通过renice人员调整进程的优先级
                普通用户只能对属于你的进程执行renice
                    普通用户只能通过renice降低进程的优先级
                    
    7,定时运行作业
        at 命令
            命令格式: at   [-f   filename]  time
            atd 守护进程----- /var/spool/at
        cron 表
            命令格式: min   hour  dayofmonth  month dayofweek command
            列出已有的cron时间表
                crontab  -l
                
                
五、高级shell脚本编程

    1,创建函数
        function  name { command }
            name 函数名称唯一
            command 一条或多条命令
        返回值
            默认退出状态码(最后一条命令返回的退出状态码) -----用$?来确定函数的退出状态码
            return 命令退出函数并返回特定的退出状态码
            1,函数一结束就取返回值;2,退出状态码必须是0~255
        函数递归
            x! = x * (x-1)!
                用简单的递归脚本
        创建库
            .   ./func
        在命令行上创建函数
            function divem { echo $[ $1 / $2 ]; }
            divem 100 5
            注意:在每个命令后面加个分号
             function doublit { read -p "Enter value:" value; echo $[ $value * 2 ]; }
                doublit
                
    2,图形化桌面的脚本编程
        菜单
            select命令
        制作窗口 dialog包
        
    3、正则表达式
    。。。。。
    
    4sed1)作用:
            1,一次从输入中读取一行数据
            2,根据所提供的编辑器命令匹配数据
            3,安装命令修改流中的数据
            4,将新的数据输出到STDOUT
        (2)sed命令选项
            -e script
                在处理输入时,将script中指定的命令添加到已有的命令中
                    如果需要多个命令,用-e选项;
                        sed -e 's/a/an/; s/test/test1/' sed.txt
            -f  file
                在处理输入时,将file中指定的命令添加到已有的命令中
                    sed  -f  script.sed   data1.txt
            -n
                不产生命令输出(-n将禁止sed编辑器输出),使用print命令来完成输出
                    sed -n 's/test/trial/p' data5.txt
        (3)命令格式:
            sed   options script  file
            命令
                echo "This is a test" | sed 's/test/big test/'
                 sed -e 's/a/an/;s/test/test1/' sed.txt
                    命令之间用分号隔开,末尾和分号之间不能有空格
        (4)sed编辑器基础
            1,默认情况下,它只替换每行中出现的第一处;  ,2,要让替换命令能够替换一行中不同的地方出现的文本必须使用替换标记substitution flag
            替换标记:s
                格式:s/pattern/replacement/flags
                4种可用的替换标记
                    1, 数字,表明新文本将替换第几处模式匹配的地方;
                        sed 's/test/trial/2' data4.txt
                    2,g,表明新文本将会替换所有匹配的文本;
                        sed  's/test/trial/g' data5.txt
                    3,p,表明原先的内容要打印出来;
                        sed -n 's/test/trial/p' data5.txt
                    4w  file, 将替换的结果写入到文件中;
                        sed -n 's/test/trial/w  test52.txt' data5.txt
                    5sed 's/\/bin\/bash/\/bin\/csh/'   /etc/passwd 可以用其他方法:(用感叹号被用做字符串分隔符)
                        sed  's!/bin/bash!/bin/csh!'   /etc/passwd
                使用地址:作用于特定行或某些行,则必须用行寻址line  addressing
                    两种形式的格式: [address]command 或 多个命令分组:address { command1   command2  command3 }
                    1,以数字形式表示行区间
                        sed '2s/dog/cat/' data1.txt 只修改指定地址的第2行修改
                             sed '2,$s/dog/cat/' data1.txt 从第2行开始的所有行修改,可以用特殊地址---美元符
                    2,用文本模式来 过滤出 行
                        /pattern/command
                            sed '/xiaoming/s/bash/csh/' /etc/passwd
                    3,命令组合
                        如果修改在单行上执行多条命令用花括号将多条命令组合在一起。
                    4,删除行
                        sed '2,4d' data1.txt 删除2,3,4行
                        sed '2d' data1.txt 删除2行
                        sed 'd' data1.txt 删除所有行
                        sed '3,$d' data1.txt 删除3行以下的行
                    5,打印
                        p命令来打印文本行
                            sed -n '2,3p' data1.txt 打印出2,3行
                                sed查找包含数字3的行
                        = 命令用来打印行号
                            sed '=' data1.txt
                                -n,能让sed只显示包含匹配的行的行号和文本
                        l (小写L)命令用来列出行
                            sed -n 'l' data1.txt
                    6,写入
                        sed '1,2w test53.txt' data1.txt
                             sed '/The/w test53.txt' data1.txt
                    7,读取
                         将文本插入到指定地址后#sed '3r data2.txt' data1.txt
                             sed '/2 The/r data2.txt' data1.txt
                                插入到末尾#sed '$r data2.txt' data1.txt
                                
    5gawk1)作用:
            1,定义变量来保持数据
            2,使用算术和字符串操作符来处理数据;
            3,通过使用结构化编程概念(比如if-then和循环)来为数据处理增加处理逻辑
            4,通过提取数据文件中的数据元素,将其重新排列或格式化,生成格式化报告。
                列如:格式化日志文件
                
        (2)gawk命令格式
            gawk  options  program  file
                用花括号定义
                
        (3)gawk命令选项
            -F  fs   指定行中划分数据字段的字段分隔符
                gawk -F: -f script3.gawk /etc/passwd
            -f  file  从指定的文件中读取程序
                gawk -f script4.gawk /etc/passwd
            -v  var=value  定义gawk程序中的一个变量及其默认值
            -mf   N  指定要处理数据文件中的最大字段数
            -mr   N  指定数据文件中的最大数据行数
            -W  keyword  指定gawk的兼容模式或告警等级
            
        (4)处理文本文件中的数据字段变量:
            1,$0 代表整个文本行
            2,$1  代表文本行中的第1个数据字段
                gawk -F':' '{print $1}' /etc/passwd
            3,$2  代表文本行中的第2个数据字段
            4,$n  代表文本行中的第n个数据字段
            5,gawk默认的字段分隔符是任意空白字符(例如空格或制表符)
    shell
    
    
六、变量

    1,test命令
        (1)test命令的文件比较功能
            -d  file   检查file是否存在并是一个目录
            -e  file   检查file是否存在
            -f   file   检查file是否存在并是一个文件
            -r  file   检查file是否存在并可读
            -s   file   检查file是否存在并非空
            -w  file 检查file是否存在并可写
            -x   file  检查file是否存在并可执行
            -O  file  检查file是否存在并属当前用户所有
            -G  file  检查file是否存在并且默认组与当前用户相同
            file1  -nt  file2 检查fiel1是否比fiel2新
            file1  -ot  file2  检查file1是否比  file2 旧
        (2)test命令的数值比较功能
            n1   -eq   n2   检查n1是否与n2  相等
            n1   -ge   n2  检查n1是否  大于或等于  n2
            n1   -gt   n2  检查n1是否与  大于  n2
            n1   -le   n2  小于或等于
            n1   -lt   n2  小于
            n1   -ne   n2  不等于
            
    2、#,#,@,0,0,1,2,2,*,$$,$?的含义
        $# 是传给脚本的参数个数
        $0 是脚本本身的名字
        $1 是传递给该shell脚本的第一个参数
        $2 是传递给该shell脚本的第二个参数
        $@ 是传给脚本的所有参数的列表
        $* 是以一个单字符串显示所有向脚本传递的参数,与位置变量不同,参数可超过9个
        $$ 是脚本运行的当前进程ID号
        $? 是显示最后命令的退出状态,0表示没有错误,其他表示有错误
        
    3、局部变量
        local  temp=$[ $value + 5 ]
    4、Linux shell 中$() ` `,${},$[] $(()),[ ] (( )) [[ ]]作用与区别
    
        $( ) 与` ` (反引号) 都是用来做命令替换用(commandsubstitution)的
            例如   version=$(uname -r)和version=`uname -r`都可以是version得到内核的版本号
        ${ }用于变量替换。一般情况下,$var 与${var} 并没有啥不一样。但是用 ${ } 会比较精确的界定变量名称的范围。
            $ echo ${A}B
            BB
        $[]    和     $(()) :
            它们是一样的,都是进行数学运算的。支持+ - * / %:分别为 “加、减、乘、除、取模”。但是注意,bash只能作整数运算,对于浮点数是当作字符串处理的。
        [ ] :
            即为test命令的另一种形式。
            
    5、双括号命令符号(( expression ))
        val++ 后增
        val-- 后减
        ++val 先增
        --val 先减
        !逻辑求反
        ~   ~  :位求反
        **  幂运算
        << 左位移
        >> 右位移
        & 位布尔和
        |  位布尔或
        && 逻辑和
        || 逻辑或
        
        
        

 

shell 示例:

  1 Mon Apr 15 07:39:15 CST 2019
  2 0731
  3 0733
  4 0741
  5 #!/bin/bash
  6 
  7 Jump_dir=/home/arthur
  8 #
  9 if [ -d $Jump_dir ]
 10 then
 11     echo "The $Jump_dir directory exists!"
 12     cd $Jump_dir
 13     ls
 14 else
 15     echo "The $Jump_dir directory dose not exist!"
 16 fi
 17 ########################
 18 #!/bin/bash
 19 
 20 #
 21 
 22 location=$HOME/my_test
 23 file_name="sentinel"
 24 #
 25 if [ -e $location ]
 26 then
 27     echo "OK on the $location directory."
 28     echo "Now checking on the file . $file_name."
 29     #
 30     if [ -e $location/$file_name ]
 31     then
 32         echo "OK on the filename."
 33         echo "Updating Current Date..."
 34         date >> $location/$file_name
 35     else
 36         echo "File does not exist."
 37         echo "Nothing to update."
 38     fi
 39 else 
 40     echo "The $location directory does not exist."
 41     echo "Nothing to update"
 42 fi
 43 ####################################
 44 #!/bin/bash
 45 
 46 item_name=$HOME/my_test/sentinel
 47 echo
 48 echo "The item being checked: $item_name"
 49 echo
 50 #
 51 if [ -e $item_name ]
 52 then
 53     echo "the item, $item_name , does exist."
 54     echo "But is it a file?"
 55     echo
 56     #
 57     if [ -f $item_name ]
 58     then
 59         echo "yes, $item_name is a file."
 60     else
 61         echo "No, $item_name is not a file."
 62     fi
 63 else
 64     echo "The item,$item_name, does not exist."
 65     echo "Noting to update."
 66 fi
 67 #################################
 68 #!/bin/bash
 69 
 70 pwfile=/etc/shadow
 71 #
 72 if [ -f $pwfile ]
 73 then
 74     if [ -r $pwfile ]
 75     then
 76         tail $pwfile
 77     else
 78         echo "Sorry, I am unable to read the $pwfile file."
 79     fi
 80 else
 81     echo "Sorry, the $pwfile dose not exist."
 82 fi
 83 #########################################
 84 #!/bin/bash
 85 
 86 file_name=$HOME/my_test/sentinel
 87 if [ -f $file_name ]
 88 then
 89     if [ -s $file_name ]
 90     then
 91         echo "The $file_name file exists and has data in it."
 92         echo "will not remove this file."
 93     else
 94         echo "The $file_name file exists, but is emputy."
 95         echo "Deleting empty file...."
 96         rm $file_name
 97     fi
 98 else
 99     echo "File, $file_name , does not exist."
100 fi
101 ######################################
102 #!/bin/bash
103 
104 item_name=$HOME/my_test/sentinel
105 echo
106 echo "The item being checked; $item_name."
107 echo
108 if [ -f $item_name ]
109 then
110     echo "Yes, $item_name is a file."
111     echo "But is it writable ?"
112     echo
113     if [ -w $item_name ]
114     then
115         echo "Writing current time to $item_name."
116         date +%H%M >> $item_name
117     else
118         echo "Unable to write to $itme_name."
119     fi
120 else
121     echo "No, $itme_name is not a file."
122 fi
123 ######################################
124 #!/bin/bash
125 
126 if [ -x test16.sh ]
127 then
128     echo "You can run the script:"
129     ./test16.sh
130 else
131     echo "Sorry, you are unable to execute the script."
132 fi
133 #!/bin/bash
134 
135 if [ -O /etc/passwd ]
136 then
137     echo "You are then owner of the /etc/passwd file."
138 else
139     echo "Sorry, you are not the owner of the /etc/passwd file."
140 fi
141 ######################################
142 #!/bin/bash
143 
144 if [ -G $HOME/my_test/testing ]
145 then
146     echo "You are in the same group as the file."
147 else
148     echo "The file is not owned by your group."
149 fi
150 ######################################
151 #!/bin/bash
152 
153 echo -n "The time and date are:"
154 date
155 echo "Let's  see...:"
156 who
157 ######################################
158 #/bin/bash
159 
160 if [ test19.sh -nt test18.sh ]
161 then
162     echo "The test19 file is newer than test18"
163 else
164     echo "The test18 file is newer than test19"
165 fi
166 if [ test17.sh -ot test19.sh ]
167 then
168     echo "The test17 file is older than the test19 file."
169 fi
170 ######################################
171 #!/bin/bash
172 
173 if [ badfile1 -nt badfile2 ]
174 then
175     echo "The badfile1 file is newer than badfile2."
176 else
177     echo "The badfile2 file is newer than badfile1."
178 fi
179 ######################################
180 #!/bin/bash
181 
182 if [ -d $HOME ] && [ -w $HOME/testing ]
183 then
184     echo "The file exists and you can write to it."
185 else 
186     echo "I cannot write to the file."
187 fi
188 ######################################
189 #!/bin/bash
190 
191 vall=10
192 if (( $vall ** 2 > 90 ))
193 then
194     (( val2 = $vall ** 2 ))
195     echo "The square of $vall is $val2."
196 fi
197 ######################################
198 #!/bin/bash
199 
200 if [[ $USER == r* ]]
201 then
202     echo "Hello, $USER"
203 else
204     echo "Sorry, I do not know you."
205 fi
206 ######################################
207 #!/bin/bash
208 
209 if [ $USER = "root" ]
210 then
211     echo "Welcome $USER"
212     echo "Please enjoy your visit"
213 elif [ $USER = "aaa" ]
214 then
215     echo "hello aaa"
216 elif [ $USER = "bbb" ]
217 then
218     echo "hello bbb"
219 else
220     echo "Sorry, you are not allowed here."
221 fi
222 ######################################
223 #!/bin/bash
224 
225 case $USER in
226 root | barbara)
227     echo "hello $USER."
228     echo "Please enjoy your visit";;
229 testing)
230     echo "Special testing account.";;
231 jessica)
232     echo "Do not forget to log off when you're done.";;
233 *)
234     echo "Sorry, you are not allowed here.";;
235 esac
test1

 

   1 #!/bin/bash
   2 
   3 for test in I don't know if this'll work
   4 do 
   5     echo "world:$test"
   6 done
   7 #!/bin/bash
   8 
   9 var1=0
  10 while echo "while iteration: $var1"
  11        [ $var1 -lt 15 ]
  12 do
  13     if [ $var1 -gt 5 ] && [ $var1 -lt 10 ]
  14     then
  15         continue
  16     fi
  17     echo "   Inside iteration number: $var1"
  18     var1=$[ $var1 + 1 ]
  19 done
  20  
  21 A
  22 B D
  23 C A
  24 D
  25 E M
  26 F
  27 G
  28 #!/bin/bash
  29 
  30 var1=10
  31 while [ $var1 -gt 0 ]
  32 do
  33     echo $var1
  34     var1=$[ $var1 - 1 ]
  35 done
  36 #!/bin/bash
  37 
  38 var1=10
  39 while echo $var1
  40            [ $var1 -ge 0 ]
  41 do
  42     echo "This is inside the loop"
  43     var1=$[ $var1 - 1 ]
  44 done
  45 /usr/local/sbin:
  46 /usr/local/bin:
  47 /usr/sbin:
  48    /usr/sbin/accessdb
  49    /usr/sbin/addgnupghome
  50    /usr/sbin/addpart
  51    /usr/sbin/adduser
  52    /usr/sbin/agetty
  53    /usr/sbin/alternatives
  54    /usr/sbin/anacron
  55    /usr/sbin/applygnupgdefaults
  56    /usr/sbin/arpd
  57    /usr/sbin/arping
  58    /usr/sbin/audispd
  59    /usr/sbin/auditctl
  60    /usr/sbin/auditd
  61    /usr/sbin/augenrules
  62    /usr/sbin/aureport
  63    /usr/sbin/ausearch
  64    /usr/sbin/authconfig
  65    /usr/sbin/authconfig-tui
  66    /usr/sbin/autrace
  67    /usr/sbin/avcstat
  68    /usr/sbin/badblocks
  69    /usr/sbin/biosdecode
  70    /usr/sbin/biosdevname
  71    /usr/sbin/blkdeactivate
  72    /usr/sbin/blkdiscard
  73    /usr/sbin/blkid
  74    /usr/sbin/blockdev
  75    /usr/sbin/bridge
  76    /usr/sbin/btrfs
  77    /usr/sbin/btrfsck
  78    /usr/sbin/btrfs-convert
  79    /usr/sbin/btrfs-debug-tree
  80    /usr/sbin/btrfs-find-root
  81    /usr/sbin/btrfs-image
  82    /usr/sbin/btrfs-map-logical
  83    /usr/sbin/btrfs-select-super
  84    /usr/sbin/btrfstune
  85    /usr/sbin/btrfs-zero-log
  86    /usr/sbin/build-locale-archive
  87    /usr/sbin/cacertdir_rehash
  88    /usr/sbin/cache_check
  89    /usr/sbin/cache_dump
  90    /usr/sbin/cache_metadata_size
  91    /usr/sbin/cache_repair
  92    /usr/sbin/cache_restore
  93    /usr/sbin/cache_writeback
  94    /usr/sbin/capsh
  95    /usr/sbin/cbq
  96    /usr/sbin/cfdisk
  97    /usr/sbin/chcpu
  98    /usr/sbin/chkconfig
  99    /usr/sbin/chpasswd
 100    /usr/sbin/chroot
 101    /usr/sbin/clock
 102    /usr/sbin/clockdiff
 103    /usr/sbin/consoletype
 104    /usr/sbin/cracklib-check
 105    /usr/sbin/cracklib-format
 106    /usr/sbin/cracklib-packer
 107    /usr/sbin/cracklib-unpacker
 108    /usr/sbin/create-cracklib-dict
 109    /usr/sbin/crond
 110    /usr/sbin/ctrlaltdel
 111    /usr/sbin/ctstat
 112    /usr/sbin/debugfs
 113    /usr/sbin/delpart
 114    /usr/sbin/depmod
 115    /usr/sbin/devlink
 116    /usr/sbin/dhclient
 117    /usr/sbin/dhclient-script
 118    /usr/sbin/dmeventd
 119    /usr/sbin/dmfilemapd
 120    /usr/sbin/dmidecode
 121    /usr/sbin/dmsetup
 122    /usr/sbin/dmstats
 123    /usr/sbin/dracut
 124    /usr/sbin/dumpe2fs
 125    /usr/sbin/e2freefrag
 126    /usr/sbin/e2fsck
 127    /usr/sbin/e2image
 128    /usr/sbin/e2label
 129    /usr/sbin/e2undo
 130    /usr/sbin/e4defrag
 131    /usr/sbin/eapol_test
 132    /usr/sbin/ebtables
 133    /usr/sbin/ebtables-restore
 134    /usr/sbin/ebtables-save
 135    /usr/sbin/era_check
 136    /usr/sbin/era_dump
 137    /usr/sbin/era_invalidate
 138    /usr/sbin/era_restore
 139    /usr/sbin/ethtool
 140    /usr/sbin/faillock
 141    /usr/sbin/fdformat
 142    /usr/sbin/fdisk
 143    /usr/sbin/filefrag
 144    /usr/sbin/findfs
 145    /usr/sbin/firewalld
 146    /usr/sbin/fixfiles
 147    /usr/sbin/fsadm
 148    /usr/sbin/fsck
 149    /usr/sbin/fsck.btrfs
 150    /usr/sbin/fsck.cramfs
 151    /usr/sbin/fsck.ext2
 152    /usr/sbin/fsck.ext3
 153    /usr/sbin/fsck.ext4
 154    /usr/sbin/fsck.minix
 155    /usr/sbin/fsck.xfs
 156    /usr/sbin/fsfreeze
 157    /usr/sbin/fstrim
 158    /usr/sbin/fxload
 159    /usr/sbin/genhomedircon
 160    /usr/sbin/genhostid
 161    /usr/sbin/genl
 162    /usr/sbin/genl-ctrl-list
 163    /usr/sbin/getcap
 164    /usr/sbin/getenforce
 165    /usr/sbin/getpcaps
 166    /usr/sbin/getsebool
 167    /usr/sbin/glibc_post_upgrade.x86_64
 168    /usr/sbin/groupadd
 169    /usr/sbin/groupdel
 170    /usr/sbin/groupmems
 171    /usr/sbin/groupmod
 172    /usr/sbin/grpck
 173    /usr/sbin/grpconv
 174    /usr/sbin/grpunconv
 175    /usr/sbin/grub2-bios-setup
 176    /usr/sbin/grub2-get-kernel-settings
 177    /usr/sbin/grub2-install
 178    /usr/sbin/grub2-macbless
 179    /usr/sbin/grub2-mkconfig
 180    /usr/sbin/grub2-ofpathname
 181    /usr/sbin/grub2-probe
 182    /usr/sbin/grub2-reboot
 183    /usr/sbin/grub2-rpm-sort
 184    /usr/sbin/grub2-set-default
 185    /usr/sbin/grub2-setpassword
 186    /usr/sbin/grub2-sparc64-setup
 187    /usr/sbin/grubby
 188    /usr/sbin/halt
 189    /usr/sbin/hardlink
 190    /usr/sbin/hwclock
 191    /usr/sbin/iconvconfig
 192    /usr/sbin/iconvconfig.x86_64
 193    /usr/sbin/ifcfg
 194    /usr/sbin/ifdown
 195    /usr/sbin/ifenslave
 196    /usr/sbin/ifstat
 197    /usr/sbin/ifup
 198    /usr/sbin/init
 199    /usr/sbin/insmod
 200    /usr/sbin/install-info
 201    /usr/sbin/installkernel
 202    /usr/sbin/intel-microcode2ucode
 203    /usr/sbin/ip
 204    /usr/sbin/ip6tables
 205    /usr/sbin/ip6tables-restore
 206    /usr/sbin/ip6tables-save
 207    /usr/sbin/iprconfig
 208    /usr/sbin/iprdbg
 209    /usr/sbin/iprdump
 210    /usr/sbin/iprinit
 211    /usr/sbin/iprsos
 212    /usr/sbin/iprupdate
 213    /usr/sbin/ipset
 214    /usr/sbin/iptables
 215    /usr/sbin/iptables-restore
 216    /usr/sbin/iptables-save
 217    /usr/sbin/irqbalance
 218    /usr/sbin/kexec
 219    /usr/sbin/killall5
 220    /usr/sbin/kpartx
 221    /usr/sbin/lchage
 222    /usr/sbin/ldattach
 223    /usr/sbin/ldconfig
 224    /usr/sbin/lgroupadd
 225    /usr/sbin/lgroupdel
 226    /usr/sbin/lgroupmod
 227    /usr/sbin/lid
 228    /usr/sbin/lnewusers
 229    /usr/sbin/lnstat
 230    /usr/sbin/load_policy
 231    /usr/sbin/logrotate
 232    /usr/sbin/logsave
 233    /usr/sbin/losetup
 234    /usr/sbin/lpasswd
 235    /usr/sbin/lshw
 236    /usr/sbin/lsmod
 237    /usr/sbin/lspci
 238    /usr/sbin/luseradd
 239    /usr/sbin/luserdel
 240    /usr/sbin/lusermod
 241    /usr/sbin/lvchange
 242    /usr/sbin/lvconvert
 243    /usr/sbin/lvcreate
 244    /usr/sbin/lvdisplay
 245    /usr/sbin/lvextend
 246    /usr/sbin/lvm
 247    /usr/sbin/lvmconf
 248    /usr/sbin/lvmconfig
 249    /usr/sbin/lvmdiskscan
 250    /usr/sbin/lvmdump
 251    /usr/sbin/lvmetad
 252    /usr/sbin/lvmpolld
 253    /usr/sbin/lvmsadc
 254    /usr/sbin/lvmsar
 255    /usr/sbin/lvreduce
 256    /usr/sbin/lvremove
 257    /usr/sbin/lvrename
 258    /usr/sbin/lvresize
 259    /usr/sbin/lvs
 260    /usr/sbin/lvscan
 261    /usr/sbin/makedumpfile
 262    /usr/sbin/matchpathcon
 263    /usr/sbin/mkdict
 264    /usr/sbin/mkdumprd
 265    /usr/sbin/mke2fs
 266    /usr/sbin/mkfs
 267    /usr/sbin/mkfs.btrfs
 268    /usr/sbin/mkfs.cramfs
 269    /usr/sbin/mkfs.ext2
 270    /usr/sbin/mkfs.ext3
 271    /usr/sbin/mkfs.ext4
 272    /usr/sbin/mkfs.minix
 273    /usr/sbin/mkfs.xfs
 274    /usr/sbin/mkhomedir_helper
 275    /usr/sbin/mklost+found
 276    /usr/sbin/mkswap
 277    /usr/sbin/modinfo
 278    /usr/sbin/modprobe
 279    /usr/sbin/mount.fuse
 280    /usr/sbin/netreport
 281    /usr/sbin/NetworkManager
 282    /usr/sbin/new-kernel-pkg
 283    /usr/sbin/newusers
 284    /usr/sbin/nl-class-add
 285    /usr/sbin/nl-class-delete
 286    /usr/sbin/nl-classid-lookup
 287    /usr/sbin/nl-class-list
 288    /usr/sbin/nl-cls-add
 289    /usr/sbin/nl-cls-delete
 290    /usr/sbin/nl-cls-list
 291    /usr/sbin/nl-link-list
 292    /usr/sbin/nl-pktloc-lookup
 293    /usr/sbin/nl-qdisc-add
 294    /usr/sbin/nl-qdisc-delete
 295    /usr/sbin/nl-qdisc-list
 296    /usr/sbin/nologin
 297    /usr/sbin/nstat
 298    /usr/sbin/ownership
 299    /usr/sbin/packer
 300    /usr/sbin/pam_console_apply
 301    /usr/sbin/pam_tally2
 302    /usr/sbin/pam_timestamp_check
 303    /usr/sbin/parted
 304    /usr/sbin/partprobe
 305    /usr/sbin/partx
 306    /usr/sbin/pdata_tools
 307    /usr/sbin/pidof
 308    /usr/sbin/ping6
 309    /usr/sbin/pivot_root
 310    /usr/sbin/plymouthd
 311    /usr/sbin/plymouth-set-default-theme
 312    /usr/sbin/postalias
 313    /usr/sbin/postcat
 314    /usr/sbin/postconf
 315    /usr/sbin/postdrop
 316    /usr/sbin/postfix
 317    /usr/sbin/postkick
 318    /usr/sbin/postlock
 319    /usr/sbin/postlog
 320    /usr/sbin/postmap
 321    /usr/sbin/postmulti
 322    /usr/sbin/postqueue
 323    /usr/sbin/postsuper
 324    /usr/sbin/poweroff
 325    /usr/sbin/ppp-watch
 326    /usr/sbin/pvchange
 327    /usr/sbin/pvck
 328    /usr/sbin/pvcreate
 329    /usr/sbin/pvdisplay
 330    /usr/sbin/pvmove
 331    /usr/sbin/pvremove
 332    /usr/sbin/pvresize
 333    /usr/sbin/pvs
 334    /usr/sbin/pvscan
 335    /usr/sbin/pwck
 336    /usr/sbin/pwconv
 337    /usr/sbin/pwhistory_helper
 338    /usr/sbin/pwunconv
 339    /usr/sbin/rdisc
 340    /usr/sbin/readprofile
 341    /usr/sbin/reboot
 342    /usr/sbin/resize2fs
 343    /usr/sbin/resizepart
 344    /usr/sbin/restorecon
 345    /usr/sbin/rmmod
 346    /usr/sbin/routef
 347    /usr/sbin/routel
 348    /usr/sbin/rsyslogd
 349    /usr/sbin/rtacct
 350    /usr/sbin/rtcwake
 351    /usr/sbin/rtmon
 352    /usr/sbin/rtpr
 353    /usr/sbin/rtstat
 354    /usr/sbin/runlevel
 355    /usr/sbin/runuser
 356    /usr/sbin/sasldblistusers2
 357    /usr/sbin/saslpasswd2
 358    /usr/sbin/sefcontext_compile
 359    /usr/sbin/selabel_digest
 360    /usr/sbin/selabel_lookup
 361    /usr/sbin/selabel_lookup_best_match
 362    /usr/sbin/selabel_partial_match
 363    /usr/sbin/selinuxconlist
 364    /usr/sbin/selinuxdefcon
 365    /usr/sbin/selinuxenabled
 366    /usr/sbin/selinuxexeccon
 367    /usr/sbin/selinux_restorecon
 368    /usr/sbin/semodule
 369    /usr/sbin/sendmail
 370    /usr/sbin/sendmail.postfix
 371    /usr/sbin/service
 372    /usr/sbin/sestatus
 373    /usr/sbin/setcap
 374    /usr/sbin/setenforce
 375    /usr/sbin/setfiles
 376    /usr/sbin/setpci
 377    /usr/sbin/setsebool
 378    /usr/sbin/sfdisk
 379    /usr/sbin/shutdown
 380    /usr/sbin/sln
 381    /usr/sbin/smtp-sink
 382    /usr/sbin/smtp-source
 383    /usr/sbin/ss
 384    /usr/sbin/sshd
 385    /usr/sbin/sshd-keygen
 386    /usr/sbin/sulogin
 387    /usr/sbin/sushell
 388    /usr/sbin/swaplabel
 389    /usr/sbin/swapoff
 390    /usr/sbin/swapon
 391    /usr/sbin/switch_root
 392    /usr/sbin/sysctl
 393    /usr/sbin/sys-unconfig
 394    /usr/sbin/tc
 395    /usr/sbin/telinit
 396    /usr/sbin/thin_check
 397    /usr/sbin/thin_delta
 398    /usr/sbin/thin_dump
 399    /usr/sbin/thin_ls
 400    /usr/sbin/thin_metadata_size
 401    /usr/sbin/thin_repair
 402    /usr/sbin/thin_restore
 403    /usr/sbin/thin_rmap
 404    /usr/sbin/thin_trim
 405    /usr/sbin/tracepath
 406    /usr/sbin/tracepath6
 407    /usr/sbin/tune2fs
 408    /usr/sbin/tuned
 409    /usr/sbin/tuned-adm
 410    /usr/sbin/udevadm
 411    /usr/sbin/unix_chkpwd
 412    /usr/sbin/unix_update
 413    /usr/sbin/update-alternatives
 414    /usr/sbin/update-pciids
 415    /usr/sbin/useradd
 416    /usr/sbin/userdel
 417    /usr/sbin/usermod
 418    /usr/sbin/usernetctl
 419    /usr/sbin/vgcfgbackup
 420    /usr/sbin/vgcfgrestore
 421    /usr/sbin/vgchange
 422    /usr/sbin/vgck
 423    /usr/sbin/vgconvert
 424    /usr/sbin/vgcreate
 425    /usr/sbin/vgdisplay
 426    /usr/sbin/vgexport
 427    /usr/sbin/vgextend
 428    /usr/sbin/vgimport
 429    /usr/sbin/vgimportclone
 430    /usr/sbin/vgmerge
 431    /usr/sbin/vgmknodes
 432    /usr/sbin/vgreduce
 433    /usr/sbin/vgremove
 434    /usr/sbin/vgrename
 435    /usr/sbin/vgs
 436    /usr/sbin/vgscan
 437    /usr/sbin/vgsplit
 438    /usr/sbin/vigr
 439    /usr/sbin/vipw
 440    /usr/sbin/virt-what
 441    /usr/sbin/visudo
 442    /usr/sbin/vmcore-dmesg
 443    /usr/sbin/vpddecode
 444    /usr/sbin/weak-modules
 445    /usr/sbin/wipefs
 446    /usr/sbin/wpa_cli
 447    /usr/sbin/wpa_passphrase
 448    /usr/sbin/wpa_supplicant
 449    /usr/sbin/xfs_admin
 450    /usr/sbin/xfs_bmap
 451    /usr/sbin/xfs_copy
 452    /usr/sbin/xfs_db
 453    /usr/sbin/xfs_estimate
 454    /usr/sbin/xfs_freeze
 455    /usr/sbin/xfs_fsr
 456    /usr/sbin/xfs_growfs
 457    /usr/sbin/xfs_info
 458    /usr/sbin/xfs_io
 459    /usr/sbin/xfs_logprint
 460    /usr/sbin/xfs_mdrestore
 461    /usr/sbin/xfs_metadump
 462    /usr/sbin/xfs_mkfile
 463    /usr/sbin/xfs_ncheck
 464    /usr/sbin/xfs_quota
 465    /usr/sbin/xfs_repair
 466    /usr/sbin/xfs_rtcp
 467    /usr/sbin/xtables-multi
 468    /usr/sbin/zdump
 469    /usr/sbin/zic
 470    /usr/sbin/zramctl
 471 /usr/bin:
 472    /usr/bin/[
 473    /usr/bin/a2p
 474    /usr/bin/addr2line
 475    /usr/bin/alias
 476    /usr/bin/apropos
 477    /usr/bin/ar
 478    /usr/bin/arch
 479    /usr/bin/as
 480    /usr/bin/aserver
 481    /usr/bin/aulast
 482    /usr/bin/aulastlog
 483    /usr/bin/ausyscall
 484    /usr/bin/auvirt
 485    /usr/bin/awk
 486    /usr/bin/base64
 487    /usr/bin/basename
 488    /usr/bin/bash
 489    /usr/bin/bashbug
 490    /usr/bin/bashbug-64
 491    /usr/bin/bc
 492    /usr/bin/bg
 493    /usr/bin/bond2team
 494    /usr/bin/bootctl
 495    /usr/bin/busctl
 496    /usr/bin/c2ph
 497    /usr/bin/cal
 498    /usr/bin/ca-legacy
 499    /usr/bin/captoinfo
 500    /usr/bin/cat
 501    /usr/bin/catchsegv
 502    /usr/bin/catman
 503    /usr/bin/cd
 504    /usr/bin/centrino-decode
 505    /usr/bin/certutil
 506    /usr/bin/c++filt
 507    /usr/bin/chacl
 508    /usr/bin/chage
 509    /usr/bin/chattr
 510    /usr/bin/chcon
 511    /usr/bin/chfn
 512    /usr/bin/chgrp
 513    /usr/bin/chmem
 514    /usr/bin/chmod
 515    /usr/bin/chown
 516    /usr/bin/chrt
 517    /usr/bin/chsh
 518    /usr/bin/chvt
 519    /usr/bin/cksum
 520    /usr/bin/clear
 521    /usr/bin/cmp
 522    /usr/bin/cmsutil
 523    /usr/bin/col
 524    /usr/bin/colcrt
 525    /usr/bin/colrm
 526    /usr/bin/column
 527    /usr/bin/comm
 528    /usr/bin/command
 529    /usr/bin/coredumpctl
 530    /usr/bin/cp
 531    /usr/bin/cpio
 532    /usr/bin/cpupower
 533    /usr/bin/crlutil
 534    /usr/bin/crontab
 535    /usr/bin/csplit
 536    /usr/bin/csslint-0.6
 537    /usr/bin/curl
 538    /usr/bin/cut
 539    /usr/bin/cvtsudoers
 540    /usr/bin/date
 541    /usr/bin/db_archive
 542    /usr/bin/db_checkpoint
 543    /usr/bin/db_deadlock
 544    /usr/bin/db_dump
 545    /usr/bin/db_dump185
 546    /usr/bin/db_hotbackup
 547    /usr/bin/db_load
 548    /usr/bin/db_log_verify
 549    /usr/bin/db_printlog
 550    /usr/bin/db_recover
 551    /usr/bin/db_replicate
 552    /usr/bin/db_stat
 553    /usr/bin/db_tuner
 554    /usr/bin/db_upgrade
 555    /usr/bin/dbus-binding-tool
 556    /usr/bin/dbus-cleanup-sockets
 557    /usr/bin/dbus-daemon
 558    /usr/bin/dbus-monitor
 559    /usr/bin/dbus-run-session
 560    /usr/bin/dbus-send
 561    /usr/bin/dbus-test-tool
 562    /usr/bin/dbus-update-activation-environment
 563    /usr/bin/dbus-uuidgen
 564    /usr/bin/db_verify
 565    /usr/bin/dc
 566    /usr/bin/dd
 567    /usr/bin/deallocvt
 568    /usr/bin/df
 569    /usr/bin/dgawk
 570    /usr/bin/diff
 571    /usr/bin/diff3
 572    /usr/bin/dir
 573    /usr/bin/dircolors
 574    /usr/bin/dirname
 575    /usr/bin/dmesg
 576    /usr/bin/dnsdomainname
 577    /usr/bin/domainname
 578    /usr/bin/dracut
 579    /usr/bin/du
 580    /usr/bin/dumpkeys
 581    /usr/bin/dwp
 582    /usr/bin/echo
 583    /usr/bin/egrep
 584    /usr/bin/eject
 585    /usr/bin/elfedit
 586    /usr/bin/env
 587    /usr/bin/envsubst
 588    /usr/bin/eqn
 589    /usr/bin/ex
 590    /usr/bin/expand
 591    /usr/bin/expr
 592    /usr/bin/factor
 593    /usr/bin/fallocate
 594    /usr/bin/false
 595    /usr/bin/fc
 596    /usr/bin/fg
 597    /usr/bin/fgconsole
 598    /usr/bin/fgrep
 599    /usr/bin/file
 600    /usr/bin/find
 601    /usr/bin/find2perl
 602    /usr/bin/findmnt
 603    /usr/bin/fipscheck
 604    /usr/bin/fipshmac
 605    /usr/bin/firewall-cmd
 606    /usr/bin/firewall-offline-cmd
 607    /usr/bin/flock
 608    /usr/bin/fmt
 609    /usr/bin/fold
 610    /usr/bin/free
 611    /usr/bin/fusermount
 612    /usr/bin/gapplication
 613    /usr/bin/gawk
 614    /usr/bin/gdbus
 615    /usr/bin/gencat
 616    /usr/bin/genl-ctrl-list
 617    /usr/bin/geoiplookup
 618    /usr/bin/geoiplookup6
 619    /usr/bin/geoipupdate
 620    /usr/bin/geqn
 621    /usr/bin/getconf
 622    /usr/bin/getent
 623    /usr/bin/getfacl
 624    /usr/bin/getkeycodes
 625    /usr/bin/getopt
 626    /usr/bin/getopts
 627    /usr/bin/gettext
 628    /usr/bin/gettext.sh
 629    /usr/bin/gio
 630    /usr/bin/gio-querymodules-64
 631    /usr/bin/glib-compile-schemas
 632    /usr/bin/gmake
 633    /usr/bin/gneqn
 634    /usr/bin/gnroff
 635    /usr/bin/gpasswd
 636    /usr/bin/gpg
 637    /usr/bin/gpg2
 638    /usr/bin/gpg-agent
 639    /usr/bin/gpgconf
 640    /usr/bin/gpg-connect-agent
 641    /usr/bin/gpg-error
 642    /usr/bin/gpgparsemail
 643    /usr/bin/gpgsplit
 644    /usr/bin/gpgv
 645    /usr/bin/gpgv2
 646    /usr/bin/gpg-zip
 647    /usr/bin/gpic
 648    /usr/bin/gprof
 649    /usr/bin/grep
 650    /usr/bin/groff
 651    /usr/bin/grops
 652    /usr/bin/grotty
 653    /usr/bin/groups
 654    /usr/bin/grub2-editenv
 655    /usr/bin/grub2-file
 656    /usr/bin/grub2-fstest
 657    /usr/bin/grub2-glue-efi
 658    /usr/bin/grub2-kbdcomp
 659    /usr/bin/grub2-menulst2cfg
 660    /usr/bin/grub2-mkfont
 661    /usr/bin/grub2-mkimage
 662    /usr/bin/grub2-mklayout
 663    /usr/bin/grub2-mknetdir
 664    /usr/bin/grub2-mkpasswd-pbkdf2
 665    /usr/bin/grub2-mkrelpath
 666    /usr/bin/grub2-mkrescue
 667    /usr/bin/grub2-mkstandalone
 668    /usr/bin/grub2-render-label
 669    /usr/bin/grub2-script-check
 670    /usr/bin/grub2-syslinux2cfg
 671    /usr/bin/gsettings
 672    /usr/bin/gsoelim
 673    /usr/bin/gtar
 674    /usr/bin/gtbl
 675    /usr/bin/gtroff
 676    /usr/bin/gunzip
 677    /usr/bin/gzexe
 678    /usr/bin/gzip
 679    /usr/bin/h2ph
 680    /usr/bin/hdsploader
 681    /usr/bin/head
 682    /usr/bin/hexdump
 683    /usr/bin/hostid
 684    /usr/bin/hostname
 685    /usr/bin/hostnamectl
 686    /usr/bin/i386
 687    /usr/bin/iconv
 688    /usr/bin/id
 689    /usr/bin/idiag-socket-details
 690    /usr/bin/idn
 691    /usr/bin/igawk
 692    /usr/bin/info
 693    /usr/bin/infocmp
 694    /usr/bin/infokey
 695    /usr/bin/infotocap
 696    /usr/bin/install
 697    /usr/bin/ionice
 698    /usr/bin/ipcalc
 699    /usr/bin/ipcmk
 700    /usr/bin/ipcrm
 701    /usr/bin/ipcs
 702    /usr/bin/iptables-xml
 703    /usr/bin/isosize
 704    /usr/bin/jobs
 705    /usr/bin/join
 706    /usr/bin/journalctl
 707    /usr/bin/kbdinfo
 708    /usr/bin/kbd_mode
 709    /usr/bin/kbdrate
 710    /usr/bin/kdumpctl
 711    /usr/bin/kernel-install
 712    /usr/bin/kill
 713    /usr/bin/kmod
 714    /usr/bin/last
 715    /usr/bin/lastb
 716    /usr/bin/lastlog
 717    /usr/bin/lchfn
 718    /usr/bin/lchsh
 719    /usr/bin/ld
 720    /usr/bin/ld.bfd
 721    /usr/bin/ldd
 722    /usr/bin/ld.gold
 723    /usr/bin/less
 724    /usr/bin/lessecho
 725    /usr/bin/lesskey
 726    /usr/bin/lesspipe.sh
 727    /usr/bin/lexgrog
 728    /usr/bin/link
 729    /usr/bin/linux32
 730    /usr/bin/linux64
 731    /usr/bin/linux-boot-prober
 732    /usr/bin/ln
 733    /usr/bin/loadkeys
 734    /usr/bin/loadunimap
 735    /usr/bin/locale
 736    /usr/bin/localectl
 737    /usr/bin/localedef
 738    /usr/bin/logger
 739    /usr/bin/login
 740    /usr/bin/loginctl
 741    /usr/bin/logname
 742    /usr/bin/look
 743    /usr/bin/ls
 744    /usr/bin/lsattr
 745    /usr/bin/lsblk
 746    /usr/bin/lscpu
 747    /usr/bin/lsinitrd
 748    /usr/bin/lsipc
 749    /usr/bin/lslocks
 750    /usr/bin/lslogins
 751    /usr/bin/lsmem
 752    /usr/bin/lsns
 753    /usr/bin/lsscsi
 754    /usr/bin/lua
 755    /usr/bin/luac
 756    /usr/bin/lz4
 757    /usr/bin/lz4c
 758    /usr/bin/lz4cat
 759    /usr/bin/machinectl
 760    /usr/bin/mailq
 761    /usr/bin/mailq.postfix
 762    /usr/bin/make
 763    /usr/bin/makedb
 764    /usr/bin/man
 765    /usr/bin/mandb
 766    /usr/bin/manpath
 767    /usr/bin/mapscrn
 768    /usr/bin/mcookie
 769    /usr/bin/md5sum
 770    /usr/bin/mesg
 771    /usr/bin/mixartloader
 772    /usr/bin/mkdir
 773    /usr/bin/mkfifo
 774    /usr/bin/mkinitrd
 775    /usr/bin/mknod
 776    /usr/bin/mktemp
 777    /usr/bin/modutil
 778    /usr/bin/more
 779    /usr/bin/mount
 780    /usr/bin/mountpoint
 781    /usr/bin/msgattrib
 782    /usr/bin/msgcat
 783    /usr/bin/msgcmp
 784    /usr/bin/msgcomm
 785    /usr/bin/msgconv
 786    /usr/bin/msgen
 787    /usr/bin/msgexec
 788    /usr/bin/msgfilter
 789    /usr/bin/msgfmt
 790    /usr/bin/msggrep
 791    /usr/bin/msghack
 792    /usr/bin/msginit
 793    /usr/bin/msgmerge
 794    /usr/bin/msgunfmt
 795    /usr/bin/msguniq
 796    /usr/bin/mv
 797    /usr/bin/namei
 798    /usr/bin/ndptool
 799    /usr/bin/neqn
 800    /usr/bin/newaliases
 801    /usr/bin/newaliases.postfix
 802    /usr/bin/newgrp
 803    /usr/bin/nf-ct-add
 804    /usr/bin/nf-ct-list
 805    /usr/bin/nf-exp-add
 806    /usr/bin/nf-exp-delete
 807    /usr/bin/nf-exp-list
 808    /usr/bin/nf-log
 809    /usr/bin/nf-monitor
 810    /usr/bin/nf-queue
 811    /usr/bin/ngettext
 812    /usr/bin/nice
 813    /usr/bin/nisdomainname
 814    /usr/bin/nl
 815    /usr/bin/nl-addr-add
 816    /usr/bin/nl-addr-delete
 817    /usr/bin/nl-addr-list
 818    /usr/bin/nl-class-add
 819    /usr/bin/nl-class-delete
 820    /usr/bin/nl-classid-lookup
 821    /usr/bin/nl-class-list
 822    /usr/bin/nl-cls-add
 823    /usr/bin/nl-cls-delete
 824    /usr/bin/nl-cls-list
 825    /usr/bin/nl-fib-lookup
 826    /usr/bin/nl-link-enslave
 827    /usr/bin/nl-link-ifindex2name
 828    /usr/bin/nl-link-list
 829    /usr/bin/nl-link-name2ifindex
 830    /usr/bin/nl-link-release
 831    /usr/bin/nl-link-set
 832    /usr/bin/nl-link-stats
 833    /usr/bin/nl-list-caches
 834    /usr/bin/nl-list-sockets
 835    /usr/bin/nl-monitor
 836    /usr/bin/nl-neigh-add
 837    /usr/bin/nl-neigh-delete
 838    /usr/bin/nl-neigh-list
 839    /usr/bin/nl-neightbl-list
 840    /usr/bin/nl-pktloc-lookup
 841    /usr/bin/nl-qdisc-add
 842    /usr/bin/nl-qdisc-delete
 843    /usr/bin/nl-qdisc-list
 844    /usr/bin/nl-route-add
 845    /usr/bin/nl-route-delete
 846    /usr/bin/nl-route-get
 847    /usr/bin/nl-route-list
 848    /usr/bin/nl-rule-list
 849    /usr/bin/nl-tctree-list
 850    /usr/bin/nl-util-addr
 851    /usr/bin/nm
 852    /usr/bin/nmcli
 853    /usr/bin/nm-online
 854    /usr/bin/nmtui
 855    /usr/bin/nmtui-connect
 856    /usr/bin/nmtui-edit
 857    /usr/bin/nmtui-hostname
 858    /usr/bin/nohup
 859    /usr/bin/nproc
 860    /usr/bin/nroff
 861    /usr/bin/nsenter
 862    /usr/bin/numfmt
 863    /usr/bin/objcopy
 864    /usr/bin/objdump
 865    /usr/bin/od
 866    /usr/bin/oldfind
 867    /usr/bin/open
 868    /usr/bin/openssl
 869    /usr/bin/openvt
 870    /usr/bin/os-prober
 871    /usr/bin/p11-kit
 872    /usr/bin/passwd
 873    /usr/bin/paste
 874    /usr/bin/pathchk
 875    /usr/bin/pchrt
 876    /usr/bin/perl
 877    /usr/bin/perl5.16.3
 878    /usr/bin/perlbug
 879    /usr/bin/perldoc
 880    /usr/bin/perlthanks
 881    /usr/bin/pflags
 882    /usr/bin/pgawk
 883    /usr/bin/pgrep
 884    /usr/bin/pic
 885    /usr/bin/piconv
 886    /usr/bin/pinentry
 887    /usr/bin/pinentry-curses
 888    /usr/bin/ping
 889    /usr/bin/ping6
 890    /usr/bin/pinky
 891    /usr/bin/pk12util
 892    /usr/bin/pkaction
 893    /usr/bin/pkcheck
 894    /usr/bin/pkexec
 895    /usr/bin/pkg-config
 896    /usr/bin/pkill
 897    /usr/bin/pkla-admin-identities
 898    /usr/bin/pkla-check-authorization
 899    /usr/bin/pkttyagent
 900    /usr/bin/pl2pm
 901    /usr/bin/pldd
 902    /usr/bin/plymouth
 903    /usr/bin/pmap
 904    /usr/bin/pod2html
 905    /usr/bin/pod2man
 906    /usr/bin/pod2text
 907    /usr/bin/pod2usage
 908    /usr/bin/post-grohtml
 909    /usr/bin/powernow-k8-decode
 910    /usr/bin/pr
 911    /usr/bin/preconv
 912    /usr/bin/pre-grohtml
 913    /usr/bin/printenv
 914    /usr/bin/printf
 915    /usr/bin/prlimit
 916    /usr/bin/ps
 917    /usr/bin/psed
 918    /usr/bin/psfaddtable
 919    /usr/bin/psfgettable
 920    /usr/bin/psfstriptable
 921    /usr/bin/psfxtable
 922    /usr/bin/pstruct
 923    /usr/bin/ptaskset
 924    /usr/bin/ptx
 925    /usr/bin/pwd
 926    /usr/bin/pwdx
 927    /usr/bin/pwmake
 928    /usr/bin/pwscore
 929    /usr/bin/pydoc
 930    /usr/bin/python
 931    /usr/bin/python2
 932    /usr/bin/python2.7
 933    /usr/bin/ranlib
 934    /usr/bin/raw
 935    /usr/bin/read
 936    /usr/bin/readelf
 937    /usr/bin/readlink
 938    /usr/bin/realpath
 939    /usr/bin/recode-sr-latin
 940    /usr/bin/rename
 941    /usr/bin/renice
 942    /usr/bin/rescan-scsi-bus.sh
 943    /usr/bin/reset
 944    /usr/bin/resizecons
 945    /usr/bin/rev
 946    /usr/bin/rm
 947    /usr/bin/rmail
 948    /usr/bin/rmail.postfix
 949    /usr/bin/rmdir
 950    /usr/bin/rpcgen
 951    /usr/bin/rpm
 952    /usr/bin/rpm2cpio
 953    /usr/bin/rpmdb
 954    /usr/bin/rpmkeys
 955    /usr/bin/rpmquery
 956    /usr/bin/rpmverify
 957    /usr/bin/rsyslog-recover-qi.pl
 958    /usr/bin/runcon
 959    /usr/bin/run-parts
 960    /usr/bin/rvi
 961    /usr/bin/rview
 962    /usr/bin/rvim
 963    /usr/bin/s2p
 964    /usr/bin/scp
 965    /usr/bin/script
 966    /usr/bin/scriptreplay
 967    /usr/bin/scsi_logging_level
 968    /usr/bin/scsi_mandat
 969    /usr/bin/scsi_readcap
 970    /usr/bin/scsi_ready
 971    /usr/bin/scsi-rescan
 972    /usr/bin/scsi_satl
 973    /usr/bin/scsi_start
 974    /usr/bin/scsi_stop
 975    /usr/bin/scsi_temperature
 976    /usr/bin/sdiff
 977    /usr/bin/secon
 978    /usr/bin/sed
 979    /usr/bin/seq
 980    /usr/bin/setarch
 981    /usr/bin/setfacl
 982    /usr/bin/setfont
 983    /usr/bin/setkeycodes
 984    /usr/bin/setleds
 985    /usr/bin/setmetamode
 986    /usr/bin/setpriv
 987    /usr/bin/setsid
 988    /usr/bin/setterm
 989    /usr/bin/setup-nsssysinit
 990    /usr/bin/setup-nsssysinit.sh
 991    /usr/bin/setvtrgb
 992    /usr/bin/sftp
 993    /usr/bin/sg
 994    /usr/bin/sg_compare_and_write
 995    /usr/bin/sg_copy_results
 996    /usr/bin/sg_dd
 997    /usr/bin/sg_decode_sense
 998    /usr/bin/sg_emc_trespass
 999    /usr/bin/sg_format
1000    /usr/bin/sg_get_config
1001    /usr/bin/sg_get_lba_status
1002    /usr/bin/sg_ident
1003    /usr/bin/sginfo
1004    /usr/bin/sg_inq
1005    /usr/bin/sg_logs
1006    /usr/bin/sg_luns
1007    /usr/bin/sg_map
1008    /usr/bin/sg_map26
1009    /usr/bin/sgm_dd
1010    /usr/bin/sg_modes
1011    /usr/bin/sg_opcodes
1012    /usr/bin/sgp_dd
1013    /usr/bin/sg_persist
1014    /usr/bin/sg_prevent
1015    /usr/bin/sg_raw
1016    /usr/bin/sg_rbuf
1017    /usr/bin/sg_rdac
1018    /usr/bin/sg_read
1019    /usr/bin/sg_read_block_limits
1020    /usr/bin/sg_read_buffer
1021    /usr/bin/sg_readcap
1022    /usr/bin/sg_read_long
1023    /usr/bin/sg_reassign
1024    /usr/bin/sg_referrals
1025    /usr/bin/sg_requests
1026    /usr/bin/sg_reset
1027    /usr/bin/sg_rmsn
1028    /usr/bin/sg_rtpg
1029    /usr/bin/sg_safte
1030    /usr/bin/sg_sanitize
1031    /usr/bin/sg_sat_identify
1032    /usr/bin/sg_sat_phy_event
1033    /usr/bin/sg_sat_set_features
1034    /usr/bin/sg_scan
1035    /usr/bin/sg_senddiag
1036    /usr/bin/sg_ses
1037    /usr/bin/sg_start
1038    /usr/bin/sg_stpg
1039    /usr/bin/sg_sync
1040    /usr/bin/sg_test_rwbuf
1041    /usr/bin/sg_turs
1042    /usr/bin/sg_unmap
1043    /usr/bin/sg_verify
1044    /usr/bin/sg_vpd
1045    /usr/bin/sg_write_buffer
1046    /usr/bin/sg_write_long
1047    /usr/bin/sg_write_same
1048    /usr/bin/sg_wr_mode
1049    /usr/bin/sg_xcopy
1050    /usr/bin/sh
1051    /usr/bin/sha1sum
1052    /usr/bin/sha224sum
1053    /usr/bin/sha256sum
1054    /usr/bin/sha384sum
1055    /usr/bin/sha512sum
1056    /usr/bin/showconsolefont
1057    /usr/bin/showkey
1058    /usr/bin/shred
1059    /usr/bin/shuf
1060    /usr/bin/signtool
1061    /usr/bin/signver
1062    /usr/bin/size
1063    /usr/bin/skill
1064    /usr/bin/slabtop
1065    /usr/bin/sleep
1066    /usr/bin/slogin
1067    /usr/bin/snice
1068    /usr/bin/soelim
1069    /usr/bin/sort
1070    /usr/bin/sotruss
1071    /usr/bin/splain
1072    /usr/bin/split
1073    /usr/bin/sprof
1074    /usr/bin/sqlite3
1075    /usr/bin/ssh
1076    /usr/bin/ssh-add
1077    /usr/bin/ssh-agent
1078    /usr/bin/ssh-copy-id
1079    /usr/bin/ssh-keygen
1080    /usr/bin/ssh-keyscan
1081    /usr/bin/ssltap
1082    /usr/bin/stat
1083    /usr/bin/stdbuf
1084    /usr/bin/strings
1085    /usr/bin/strip
1086    /usr/bin/stty
1087    /usr/bin/su
1088    /usr/bin/sudo
1089    /usr/bin/sudoedit
1090    /usr/bin/sudoreplay
1091    /usr/bin/sum
1092    /usr/bin/sync
1093    /usr/bin/systemctl
1094    /usr/bin/systemd-analyze
1095    /usr/bin/systemd-ask-password
1096    /usr/bin/systemd-cat
1097    /usr/bin/systemd-cgls
1098    /usr/bin/systemd-cgtop
1099    /usr/bin/systemd-coredumpctl
1100    /usr/bin/systemd-delta
1101    /usr/bin/systemd-detect-virt
1102    /usr/bin/systemd-escape
1103    /usr/bin/systemd-firstboot
1104    /usr/bin/systemd-hwdb
1105    /usr/bin/systemd-inhibit
1106    /usr/bin/systemd-loginctl
1107    /usr/bin/systemd-machine-id-setup
1108    /usr/bin/systemd-notify
1109    /usr/bin/systemd-nspawn
1110    /usr/bin/systemd-path
1111    /usr/bin/systemd-run
1112    /usr/bin/systemd-stdio-bridge
1113    /usr/bin/systemd-sysv-convert
1114    /usr/bin/systemd-tmpfiles
1115    /usr/bin/systemd-tty-ask-password-agent
1116    /usr/bin/tabs
1117    /usr/bin/tac
1118    /usr/bin/tail
1119    /usr/bin/tailf
1120    /usr/bin/tar
1121    /usr/bin/taskset
1122    /usr/bin/tbl
1123    /usr/bin/teamd
1124    /usr/bin/teamdctl
1125    /usr/bin/teamnl
1126    /usr/bin/tee
1127    /usr/bin/test
1128    /usr/bin/testgdbm
1129    /usr/bin/tic
1130    /usr/bin/timedatectl
1131    /usr/bin/timeout
1132    /usr/bin/tload
1133    /usr/bin/tmon
1134    /usr/bin/toe
1135    /usr/bin/top
1136    /usr/bin/touch
1137    /usr/bin/tput
1138    /usr/bin/tr
1139    /usr/bin/tracepath
1140    /usr/bin/tracepath6
1141    /usr/bin/troff
1142    /usr/bin/true
1143    /usr/bin/truncate
1144    /usr/bin/trust
1145    /usr/bin/tset
1146    /usr/bin/tsort
1147    /usr/bin/tty
1148    /usr/bin/turbostat
1149    /usr/bin/tzselect
1150    /usr/bin/udevadm
1151    /usr/bin/ul
1152    /usr/bin/ulockmgr_server
1153    /usr/bin/umask
1154    /usr/bin/umount
1155    /usr/bin/unalias
1156    /usr/bin/uname
1157    /usr/bin/unexpand
1158    /usr/bin/unicode_start
1159    /usr/bin/unicode_stop
1160    /usr/bin/uniq
1161    /usr/bin/unlink
1162    /usr/bin/unlz4
1163    /usr/bin/unshare
1164    /usr/bin/unxz
1165    /usr/bin/update-ca-trust
1166    /usr/bin/update-mime-database
1167    /usr/bin/uptime
1168    /usr/bin/urlgrabber
1169    /usr/bin/users
1170    /usr/bin/usleep
1171    /usr/bin/usx2yloader
1172    /usr/bin/utmpdump
1173    /usr/bin/uuidgen
1174    /usr/bin/vdir
1175    /usr/bin/VGAuthService
1176    /usr/bin/vi
1177    /usr/bin/view
1178    /usr/bin/vim
1179    /usr/bin/vimdiff
1180    /usr/bin/vimtutor
1181    /usr/bin/vlock
1182    /usr/bin/vmhgfs-fuse
1183    /usr/bin/vmstat
1184    /usr/bin/vm-support
1185    /usr/bin/vmtoolsd
1186    /usr/bin/vmware-checkvm
1187    /usr/bin/vmware-guestproxycerttool
1188    /usr/bin/vmware-hgfsclient
1189    /usr/bin/vmware-namespace-cmd
1190    /usr/bin/vmware-rpctool
1191    /usr/bin/vmware-toolbox-cmd
1192    /usr/bin/vmware-vgauth-cmd
1193    /usr/bin/vmware-xferlogs
1194    /usr/bin/vxloader
1195    /usr/bin/w
1196    /usr/bin/wait
1197    /usr/bin/wall
1198    /usr/bin/watch
1199    /usr/bin/watchgnupg
1200    /usr/bin/wc
1201    /usr/bin/wdctl
1202    /usr/bin/whatis
1203    /usr/bin/whereis
1204    /usr/bin/which
1205    /usr/bin/whiptail
1206    /usr/bin/who
1207    /usr/bin/whoami
1208    /usr/bin/write
1209    /usr/bin/x86_64
1210    /usr/bin/x86_energy_perf_policy
1211    /usr/bin/xargs
1212    /usr/bin/xgettext
1213    /usr/bin/xmlcatalog
1214    /usr/bin/xmllint
1215    /usr/bin/xmlsec1
1216    /usr/bin/xmlwf
1217    /usr/bin/xsltproc
1218    /usr/bin/xxd
1219    /usr/bin/xz
1220    /usr/bin/xzcat
1221    /usr/bin/xzcmp
1222    /usr/bin/xzdec
1223    /usr/bin/xzdiff
1224    /usr/bin/xzegrep
1225    /usr/bin/xzfgrep
1226    /usr/bin/xzgrep
1227    /usr/bin/xzless
1228    /usr/bin/xzmore
1229    /usr/bin/yes
1230    /usr/bin/ypdomainname
1231    /usr/bin/yum
1232    /usr/bin/zcat
1233    /usr/bin/zcmp
1234    /usr/bin/zdiff
1235    /usr/bin/zegrep
1236    /usr/bin/zfgrep
1237    /usr/bin/zforce
1238    /usr/bin/zgrep
1239    /usr/bin/zless
1240    /usr/bin/zmore
1241    /usr/bin/znew
1242    /usr/bin/zsoelim
1243 /root/bin:
1244 The number is 1
1245 The number is 2
1246 The number is 3
1247 The number is 4
1248 The number is 5
1249 The number is 6
1250 The number is 7
1251 The number is 8
1252 The number is 9
1253 #!/bin/bash
1254 
1255 var1=100
1256 until [ $var1 -eq 0 ]
1257 do 
1258     echo $var1
1259     var1=$[ $var1 - 25 ]
1260 done
1261 #!/bin/bash
1262 
1263 var1=100
1264 until echo $var1
1265         [ $var1 -eq 0 ]
1266 do
1267     echo Inside the loop: $var1
1268     var1=$[ $var1 -25 ]
1269 done
1270 #!/bin/bash
1271 
1272 for (( a=1; a<=3; a++ ))
1273 do 
1274     echo "Starting lop $a:"
1275     for (( b=1; b<=3; b++ ))
1276     do
1277         echo "    Inside loop: $b"
1278     done
1279 done
1280 #!/bin/bash
1281 
1282 var1=5
1283 while [ $var1 -ge 0 ]
1284 do
1285     echo "Outer loop: $var1"
1286     for (( var2=1; $var2 < 3; var2++ ))
1287     do
1288         var3=$[ $var1 * $var2]
1289         echo "    Inner loop: $var1 * $var2 = $var3"
1290     done
1291     var1=$[ $var1 - 1]
1292 done
1293 #!/bin/bash
1294 
1295 var1=3
1296 until [ $var1 -eq 0 ]
1297 do
1298     echo "Outer loop: $var1"
1299     var2=1
1300     while [ $var2 -lt 5 ]
1301     do
1302         var3=$(echo "scale=4; $var1 / $var2" | bc)
1303         echo "  Inner loop: $var1 / $var2 = $var3"
1304         var2=$[ $var2 + 1 ]
1305     done
1306     var1=$[ $var1 - 1 ]
1307 done
1308 #!/bin/bash
1309 
1310 IFS.OLD=$IFS
1311 IFS=$'\n'
1312 for entry in $(cat /etc/passwd):
1313 do
1314     echo "Values in $entry -"
1315     IFS=:
1316     for value in $entry
1317     do
1318         echo "    $value"
1319     done
1320 done
1321 #!/bin/bash
1322 
1323 for var1 in 1 2 3 4 5 6 7 8 9 10
1324 do
1325     if [ $var1 -eq 5 ]
1326     then
1327         echo "good 5 !"
1328         break
1329     fi
1330     echo "Iteration number: $var1"
1331 done
1332 echo "The for loop is completed"
1333 #!/bin/bash
1334 
1335 var1=1
1336 
1337 while [ $var1 -lt 10 ]
1338 do
1339     if [ $var1 -eq 5 ]
1340     then
1341         break
1342     fi
1343     echo "Iteration: $var1"
1344     var1=$[ $var1 + 1 ]
1345 done
1346 echo "The while loop is completed."
1347 #!/bin/bash
1348 
1349 for (( a = 1; a < 4; a++ ))
1350 do
1351     echo "Outer loop: $a"
1352     for (( b = 1; b < 100; b++))
1353     do
1354         if [ $b -eq 5 ]
1355         then
1356             break
1357         fi
1358         echo "    Inner loop: $b"
1359     done
1360 done
1361 #!/bin/bash
1362 
1363 for test in Alabama Alaska Arizona Arkansas California Colorado
1364 do
1365     echo "The next state is $test"
1366 done
1367 echo "The last state we visited was $test"
1368 test=Connecticut
1369 echo "Wait, now we're visiting $test."
1370 #!/bin/bash
1371 
1372 for test in Alabama Alaska Arizona Arkansas California Colorado
1373 do
1374     echo The next state is $test
1375 done
1376 #!/bin/bash
1377 
1378 for (( a = 1; a < 4; a++ ))
1379 do
1380     echo "Outer loop: $a"
1381     for (( b = 1; b < 100; b++ ))
1382     do
1383         if [ $b -gt 4 ]
1384         then 
1385             break 2
1386         fi
1387         echo "   Inner loop: $b"
1388     done
1389 done
1390    
1391 #!/bin/bash
1392 
1393 for (( var1 = 1; var1 < 15; var1++ ))
1394 do
1395     if [ $var1 -gt 5  ] && [ $var1 -lt 10 ]
1396     then
1397         continue
1398     fi
1399     echo "Iteration number: $var1"
1400 done
1401 #!/bin/bash
1402 
1403 for file in /home/haolb/*
1404 do
1405     if [ -d "$file" ]
1406     then
1407         echo "$file is a directory."
1408     elif
1409         echo "$file is a file."
1410     fi
1411 done > output.txt
1412 
1413 #!/bin/bash
1414 
1415 for (( a = 1; a <= 5; a++ ))
1416 do
1417     echo "Iteration $a:"
1418     for (( b = 1; b <3; b++ ))
1419     do
1420         if [ $a -gt 2 ] && [ $a -lt 4 ]
1421         then
1422             continue 2
1423         fi
1424         var3=$[ $a * $b]
1425         echo "   The result of $a * $b is $var3."
1426     done
1427 done
1428 #!/bin/bash
1429 
1430 for (( a = 1; a < 10; a++ ))
1431 do
1432     echo "The number is $a"
1433 done > test123.txt
1434 echo "The command is finished."
1435 #!/bin/bash
1436 
1437 for state in "North Dakota" Connecticut Illinois Alabama Tennessee
1438 do
1439     echo "$state is netxt place to go."
1440 done | sort
1441 echo "This completes our travels."
1442 #!/bin/bash
1443 
1444 IFS=:
1445 for folder in $PATH
1446 do
1447     echo "$folder:"
1448     for file in $folder/*
1449     do
1450         if [ -x $file ]
1451         then
1452             echo "   $file"
1453         fi
1454     done
1455 done > test120.txt
1456 
1457 #!/bin/bash
1458 
1459 input="users.csv"
1460 while IFS=',' read -r userid name
1461 do
1462     echo "adding $userid"
1463     useradd -c "$name" -m $userid
1464 done < "$input"
1465 #!/bin/bash
1466 
1467 for test in I don\'t know if "this'll" work
1468 do 
1469     echo "world:$test"
1470 done
1471 
1472 #!/bin/bash
1473 
1474 for test in Nevada "New Hampshire" "New Mexico" "New York"
1475 do
1476     echo "Now going to $test"
1477 done
1478 #!/bin/bash
1479 
1480 list="Alabama Alaska Arizona Arkansas California Colorado"
1481 list=$list" Connecticut"
1482 for state in $list
1483 do
1484     echo "Have you ever visited $state?"
1485 done
1486 #!/bin/bash
1487 
1488 file="/etc/passwd"
1489 IFS=$':' 
1490 
1491 for i in $(cat $file)
1492 do
1493     echo $i
1494 done
1495 #!/bin/bash
1496 
1497 file="states"
1498 IFS="\n"
1499 for state in $(cat $file)
1500 do
1501     echo "Visit beautiful $state"
1502 done
1503 #!/bin/bash
1504 
1505 file="states"
1506 
1507 for state in $(cat $file)
1508 do
1509     echo "Visit beautiful $state"
1510 done
1511 #!/bin/bash
1512 
1513 for file in /root/my_test/*
1514 do
1515     if [ -d "$file" ]
1516     then
1517         echo "$file is a directory."
1518     elif [ -f "$file" ]
1519     then
1520         echo "$file is a file."
1521     fi
1522 done
1523 #!/bin/bash
1524 
1525 for (( i=1; i <= 10; i++ ))
1526 do
1527     echo "The next number is $i"
1528 done
1529 #!/bin/bash
1530 
1531 for (( a=1, b=10; a <= 10; a++, b-- ))
1532 do
1533     echo "$a - $b"
1534 done
test2
  1 #!/bin/bash
  2 
  3 name=$(basename $0)
  4 
  5 if [ $name = "addem" ]
  6 then
  7     total=$[ $1 + $2 ]
  8 elif [ $name = "multem" ]
  9 then
 10     total=$[ $1 * $2]
 11 fi
 12 echo
 13 echo The calculated value is $total
 14 #!/bin/bash
 15 
 16 name=$(basename $0)
 17 
 18 if [ $name = "addem" ]
 19 then
 20     total=$[ $1 + $2 ]
 21 elif [ $name = "multem" ]
 22 then
 23     total=$[ $1 * $2]
 24 fi
 25 echo
 26 echo The calculated value is $total
 27 11111111111111111111
 28 22222222222222222222
 29 33333333333333333333
 30 434444444444444444
 31 44444444444444444444
 32 4
 33 555555555555555
 34 6666666666666666666
 35 777777777777777777
 36 #!/bin/bash
 37 
 38 params=$#
 39 echo
 40 echo The last parameter is $params
 41 echo The last parameter is ${!#}
 42 echo
 43 #!/bin/bash
 44 
 45 echo
 46 echo "Using the \$* method: $*"
 47 echo
 48 echo "Using the \$@ method: $@"
 49 #!/bin/bash
 50 
 51 echo
 52 count=1
 53 for param in "$*"
 54 do
 55     echo "\$* Parameter #$count = $param"
 56     count=$[ $count + 1 ]
 57 done
 58 echo
 59 count=1
 60 for param in "$@"
 61 do
 62     echo "\$@ Parameter #$count = $param"
 63     count=$[ $count + 1 ]
 64 done
 65 #!/bin/bash
 66 
 67 echo
 68 count=1
 69 while [ -n "$1" ]
 70 do
 71     echo "Parameter #$count = $1"
 72     count=$[ $count + 1 ]
 73     shift
 74 done
 75 #!/bin/bash
 76 
 77 echo 
 78 echo "The original parameters: $*"
 79 shift 2
 80 echo "Here's the new first parameter: $1"
 81 #!/bin/bash
 82 
 83 echo
 84 while [ -n "$1" ]
 85 do
 86     case "$1" in
 87       -a) echo "Found the -a option";;
 88       -b) echo "Found the -b option";;
 89       -c) echo "Found the -c option";;
 90       *) echo "$1 is not an  option";;
 91     esac
 92     shift
 93 done
 94 
 95 #!/bin/bash
 96 
 97 echo
 98 while [ -n "$1" ]
 99 do
100     case "$1" in
101       -a) echo "Found the -a option";;
102       -b) echo "Found the -b option";;
103       -c) echo "Found the -c option";;
104       --) shift
105           break ;;
106       *) echo "$1 is not an  option";;
107     esac
108     shift
109 done
110 count=1
111 for param in $@
112 do
113     echo "Parameter #$count: $param"
114     count=$[ $count + 1 ]
115 done
116 #!/bin/bash
117 
118 echo
119 while [ -n "$1" ]
120 do
121     case "$1" in
122       -a) echo "Found the -a option";;
123       -b) param="$2"
124           echo "Fount the -b option, whith parameter value $param"
125           shift ;;
126       -c) echo "Found the -c option";;
127       --) shift
128           break ;;
129       *) echo "$1 is not an  option";;
130     esac
131     shift
132 done
133 count=1
134 for param in $@
135 do
136     echo "Parameter #$count: $param"
137     count=$[ $count + 1 ]
138 done
139 #!/bin/bash
140 
141 factorial=1
142 for (( number = 1; number <= $1; number++ ))
143 do
144     factorial=$[ $factorial * $number ]
145 done
146 echo The factorial of $1 is $factorial
147 #!/bin/bash
148 
149 echo -n "Enter your name:"
150 read name
151 echo "Hello $name, welcome to my program."
152 #!/bin/bash
153 read -p "Please enter your age:" age
154 days=$[ $age * 365 ]
155 echo "That makes you over $days days old!"
156 #!/bin/bash
157 
158 read -n1 -p "Do you want to continue [Y|N]?" answer
159 case $answer in
160 Y|y) echo
161      echo "fine, continue on...";;
162 N|n) echo
163      echo OK, goodbye
164      exit ;;
165 esac
166 echo "This is the end of the script"
167 #!/bin/bash
168 
169 read -s -p "Enter your password:" pass
170 echo
171 echo "Is your password readlly $pass"
172 #!/bin/bash
173 
174 count=1
175 cat test | while read line
176 do
177     echo "Line $count : $line"
178     count=$[ $count + 1 ]
179 done
180 echo "Finished processing the file"
181 #!/bin/bash
182 
183 total=$[ $1 * $2 ]
184 echo The first parameter is $1 
185 echo The second parameter is $2
186 echo The total value is $total
187 #!/bin/bash
188 
189 echo Hello $1, glad to meet you.
190 #!/bin/bash
191 
192 total=$[ ${10} * ${11} ]
193 echo The tenth parameter is ${10}
194 echo The elevent parameter is ${11}
195 echo The total is $total
196 #!/bin/bash
197 
198 name=$(basename $0)
199 echo
200 echo The script name is : $name
201 #!/bin/bash
202 
203 echo The zero parameter is set to : $0
204 #!/bin/bash
205 
206 name=$(basename $0)
207 
208 if [ $name = "addem" ]
209 then
210     total=$[ $1 + $2 ]
211 elif [ $name = "multem" ]
212 then
213     total=$[ $1 * $2]
214 fi
215 echo
216 echo The calculated value is $total
217 #!/bin/bash
218 
219 if [ -n "$1" ]
220 then 
221     echo Hello $1, glad to meet you.
222 else
223     echo "Sorry, you did not identify yourself."
224 fi
225 #!/bin/bash
226 
227 echo There were $# parameters supplied.
228 #!/bin/bash
229 
230 if [ $# -ne 2 ]
231 then
232     echo
233     echo Usage: test90.sh a b
234     echo
235 else
236     total=$[ $1 + $2]
237     echo
238     echo The total is $total
239     echo
240 fi
test3

 

 1 BB,RR,123 mm s,CC,IL,66666
 2 CC,Rw,234 kk e,DD,II,77777
 3 
 4 #!/bin/bash
 5 
 6 exec 1> testout
 7 
 8 echo "aaaaa"
 9 echo "bbbbb"
10 echo "ccccc"
11 #!/bin/bash
12 
13 exec 2> testerr
14 
15 echo "aaaaa"
16 echo "bbbbb"
17 
18 exec 1> testout
19 
20 echo "ddddd"
21 echo "eeeee" >&2
22 #!/bin/bash
23 
24 exec 0< testfile
25 count=1
26 
27 while read line
28 do
29     echo "Line #$count : $line"
30     count=$[ $count + 1 ]
31 done
32 This should store in the output file.
33 along with tnis line.
34 #!/bin/bash
35 
36 exec 3>&1
37 exec 1>test14out
38 
39 echo "This should store in the output file."
40 echo "along with tnis line."
41 
42 exec 1>&3
43 
44 echo "Now things should be back to normal"
45 #!/bin/bash
46 
47 exec 6<&0
48 
49 exec 0< testfile
50 
51 count=1
52 while read line
53 do
54     echo "Line #$count: $line"
55     count=$[ $count + 1 ]
56 done
57 exec 0<&6
58 read -p "Are you done now?" answer
59 case $answer in
60 Y|y) echo "Goodbye";;
61 N|n) echo "Sorry, this is the end.";;
62 esac
63 #!/bin/bash
64 
65 outfile='members.sql'
66 IFS=','
67 while read lname fname address city state zip
68 do
69     cat >> $outfile << EOF
70     INSERT INTO members (lname,fname,address,city,state,zip) VALUES
71 ('$lname','$fname','$address','$city','$state','$zip');
72 EOF
73 done < ${1}
74 #!/bin/bash
75 
76 echo "This is an error" >&2
77 echo "This is normal output"
78 This is an error
79 eeeee
80 Thu May  9 07:38:06 CST 2019
81 root     pts/0        2019-05-09 07:26 (192.168.1.102)
82 ddddd
83 #!/bin/bash
84 
85 exec 3<> testfile
86 read line <&3
87 echo "Read: $line"
88 echo "This is a test line"
test4
  1 This is a test script
  2 Loop #1
  3 Loop #2
  4 Loop #3
  5 Loop #4
  6 Loop #5
  7 Loop #6
  8 Loop #7
  9 Loop #8
 10 Loop #9
 11 Loop #10
 12 This si the end of the test script
 13 Script process ID:8104
 14 Loop #1
 15 Loop #2
 16 Loop #3
 17 Loop #4
 18 Loop #5
 19 Loop #6
 20 Loop #7
 21 Loop #8
 22 Loop #9
 23 Loop #10
 24 End of script
 25 #!/bin/bash
 26 echo "Script process ID:$$"
 27 count=1
 28 while [ $count -le 10 ]
 29 do
 30     echo "Loop #$count"
 31     sleep 10
 32     count=$[ $count + 1 ]
 33 done
 34 
 35 echo "End of script"
 36 #!/bin/bash
 37 
 38 echo "This script ran at $(date +%B%d,%T)"
 39 echo
 40 sleep 5
 41 echo "This is  the script's end...."
 42 #!/bin/bash
 43 
 44 trap "echo 'Sorry! I have trapped ctrl+c'"  SIGINT
 45 
 46 echo This is a test script
 47 count=1
 48 while [ $count -le 10 ]
 49 do
 50     echo "Loop #$count"
 51     sleep 1
 52     count=$[ $count + 1 ]
 53 done
 54 echo "This si the end of the test script"
 55 #!/bin/bash
 56 
 57 
 58 trap "echo GOODBYE..." EXIT
 59 
 60 count=1
 61 while [ $count -le 5 ]
 62 do
 63     echo "LOOP #$count"
 64     sleep 1
 65     count=$[ $count + 1 ]
 66 done
 67 #!/bin/bash
 68 
 69 trap "echo 'Sorry ... Ctrl + C is trapped.'" SIGINT
 70 
 71 count=1
 72 while [ $count -le 5 ]
 73 do
 74     echo "Loop #$count"
 75     sleep 1
 76     count=$[ $count + 1 ]
 77 done
 78 trap "echo 'I modified the trap!' " SIGINT
 79 count=1
 80 while [ $count -le 5 ]
 81 do
 82     echo "Secound Loop #$count"
 83     sleep 1
 84     count=$[ $count + 1 ]
 85 done
 86 
 87 trap -- SIGINT
 88 echo "I just removed the trap"
 89 count=1
 90 while [ $count -le 5 ]
 91 do
 92     echo "remove Loop #$count"
 93     sleep 1
 94     count=$[ $count + 1 ]
 95 done
 96 #!/bin/bash
 97 
 98 count=1
 99 
100 while [  $count -le 10  ]
101 do
102     sleep 1
103     count=$[ $count + 1 ]
104 
105 done
106 
107 #!/bin/bash
108 echo "start the test script"
109 count=1
110 while [ $count -le 5 ]
111 do
112     echo "Loop #$count"
113     count=$[ $count + 1 ]
114 
115 done
116 echo "The scripts is complete"
test5
  1 #my script functions
  2 
  3 function addem {
  4     echo $[ $1 + $2 ]
  5 }
  6 
  7 function multem {
  8     echo $[ $1 * $2 ]
  9 }
 10 
 11 function divem {
 12     if [ $2 -ne 0 ]
 13     then
 14         echo $[ $1 / $2 ]
 15     else
 16         echo -1
 17     fi
 18 }
 19 #!/bin/bash
 20 
 21 function testit {
 22     local newarray
 23     newarray=('echo "$@"')
 24     echo "The new array value is: ${newarray[*]}"
 25 }
 26 
 27 myarray=(1,2,3,4,5)
 28 echo "The original array is ${myarray[*]}"
 29 testit ${myarray[*]}
 30 #!/bin/bash
 31 
 32 function arraydb1r {
 33     local origarray
 34     local newarray
 35     local elements
 36     local i
 37     origarray=($(echo "$@"))
 38     newarray=($(echo "$@"))
 39     elements=$[ $# - 1 ]
 40     for (( i = 0; i <= $elements; i++ ))
 41     {
 42         newarray[$i]=$[  ${origarray[$i]} * 2  ]   
 43     }
 44     echo ${newarray[*]}
 45 }
 46 
 47 myarray=(1,2,3,4,5)
 48 echo "The origarray array is ${myarray[*]}"
 49 arg1=$(echo ${myarray[*]})
 50 result=($(arraydb1r $arg1))
 51 echo "The new array is: ${result[*]}"
 52 
 53 
 54 #!/bin/bash
 55 
 56 function factorial {
 57     if [ $1 -eq 1 ]
 58     then
 59         echo 1
 60     else
 61         local temp=$[ $1 -1 ]
 62         local result=$(factorial $temp)
 63         echo $[ $result * $1 ]
 64     fi
 65 }
 66 
 67 read -p "Enter value: " value
 68 result=$(factorial $value)
 69 echo "The factorial of $value is: $result"
 70 #!/bin/bash
 71 
 72 . ./myfuncs.sh
 73 
 74 value1=10
 75 value2=5
 76 
 77 result1=$(addem $value1  $value2)
 78 result2=$(multem $value1  $value2)
 79 result3=$(divem $value1  $value2)
 80 
 81 echo "The result of adding them is $result1"
 82 echo "The result of multiplying them is $result2"
 83 echo "The result of dividing them is $result3"
 84 #!/bin/bash
 85 
 86 function test1 {
 87     echo "This is an example of a function"
 88 
 89 }
 90 
 91 count=1
 92 while [ $count -le 5 ]
 93 do
 94     test1
 95     count=$[ $count + 1 ]
 96 done
 97 
 98 echo "This is the end of the loop"
 99 test1
100 echo "Now this is the end of the script."
101 #!/bin/bash
102 
103 count=1
104 echo "This line comes before the function definition"
105 
106 function test1 {
107     echo "This is an example of a function"
108 }
109 
110 while [ $count -le 5 ]
111 do
112     test1
113     count=$[ $count + 1 ]
114 done
115 echo "This is the end of the script"
116 test2
117 function test2 {
118     echo "This is an exampple of a function...."
119 }
120 
121 #!/bin/bash
122 
123 func1() {
124     echo "trying to display a non-existent file."
125     ls -l badfile
126 }
127 echo
128 func1
129 echo "$?"
130 #!/bin/bash
131 
132 function db1 {
133     read -p "Enter a value:" value
134     echo $[ $value * 2 ]
135 }
136 
137 result=$(db1)
138 echo "The new value is $result"
139 #!/bin/bash
140 
141 function db1 {
142     read -p 'Enter a value' value
143     echo "doubling the value"
144     return $[ $value * 2  ]
145 }
146 db1
147 echo "The new value is $?"
148 #!/bin/bash
149 
150 function addem {
151     if [ $# -eq 0 ] || [ $# -gt 2 ]
152     then
153         echo -1
154     elif [ $# -eq 1 ]
155     then
156         echo $[ $1 + $1 ]
157     else
158         echo $[ $1 + $2 ]  
159     fi
160 }
161 
162 echo -n "Adding 10 and 15:"
163 value=$(addem 10 15)
164 echo $value
165 echo -n "Let's try adding just one numnber:"
166 value=$(addem 10)
167 echo $value
168 echo -n "Now trying adding no numbers:"
169 value=$(addem)
170 echo $value
171 echo -n "Finally,try adding three numbers:"
172 value=$(addem 10 15 20)
173 echo $value
174 
175 #!/bin/bash
176 
177 function func1 {
178     echo $[ $1 * $2 ] 
179 
180 }
181 
182 if [ $# -eq 2 ]
183 then
184     value=$(func1 $1 $2)
185     echo "This result is $value"
186 else
187     "Usage:badtest1 a b"
188 fi
189 #!/bin/bash
190 
191 function db1 {
192     value=$[ $value * 2 ]
193 }
194 read -p "Enter a value:" value
195 db1
196 echo "The new value is $value"
197 
198 #!/bin/bash
199 
200 function func1 {
201     local temp=$[ $value + 5 ]
202     result=$[ $temp * 2 ]
203 }
204 temp=4
205 value=6
206 
207 func1
208 echo "The result is $result"
209 if [ $temp -gt $value ]
210 then
211     echo "temp is larger"
212 else
213     echo "temp is smaller"
214 fi
test6
  1 /root/#!/bin/bash
  2 
  3 function diskspace {
  4     clear
  5     df -h
  6 }
  7 
  8 function whoseon {
  9     clear
 10     who
 11 }
 12 
 13 function menusage {
 14     clear
 15     cat /proc/meminfo
 16 }
 17 
 18 function menu {
 19     clear
 20     echo 
 21     echo -e "\t\t\tSys Admin Menu\n"
 22     echo -e "\t1. Display disk space."
 23     echo -e "\t2. Display logged on users"
 24     echo -e "\t3. Display memory usage"
 25     echo -e "\t4. Exit Program\n\n "
 26     echo -en "\t\t Enter option: "
 27     read -n 1 option
 28 }
 29 
 30 while [ 1 ]
 31 do
 32     menu
 33     case $option in
 34     0)
 35         break ;;
 36     1)
 37         diskspace ;;
 38     2)
 39         whoseon ;;
 40     3)
 41         menusage ;;
 42     *)
 43         clear
 44         echo "Sorry, wrong selection" ;;
 45     esac
 46     echo -en "\n\n\t\t\tHit any key to continue:"
 47     read -n 1 line
 48 done
 49 clear
 50 
 51 #!/bin/bash
 52 
 53 temp=$(mktemp -t test.XXXXXX)
 54 temp2=$(mktemp -t test2.XXXXXX)
 55 
 56 function diskspace {
 57     df -h > $temp
 58     dialog --textbox $temp 20 60
 59 }
 60 
 61 function whoseon {
 62     who > $temp
 63     dialog --textbox $temp 20 50
 64 }
 65 
 66 function memusage {
 67     cat /proc/meminfo > $temp
 68     dialog --textbox $temp 20 50
 69 }
 70 
 71 while [ 1 ]
 72 do
 73 dialog --menu "Sys Admin Menu" 20 30 10 1 "Display disk space" 2 "Display users" 3 "Display memory usage" 0 "Exit" 2> $temp2
 74 if [ $? -eq 1 ]
 75 then    break
 76 fi
 77 
 78 selection=$(cat $temp2)
 79 
 80 case $selection in 
 81 1)
 82     diskspace ;;
 83 2)
 84     whoseon ;;
 85 3) 
 86     memusage ;;
 87 0)
 88     break ;;
 89 *)
 90     dialog --msgbox "Sorry, invalid selection" 10 30
 91 esac
 92 done
 93 rm -rf $temp 2> /dev/null
 94 rm -rf $temp2 2> /dev/null
 95 
 96 #!/bin/bash
 97 
 98 function diskspace {
 99     clear
100     df -h
101 }
102 
103 function whoseon {
104     clear
105     who
106 }
107 
108 function menusage {
109     clear
110     cat /proc/meminfo
111 }
112 
113 
114 
115 PS3="Enter option: "
116 select option in "Display disk space" "Display logged on users" "Display memory usage" "Exit Program"
117 do
118     menu
119     case $option in
120     "Exit Program")
121         break ;;
122     "Display disk space")
123         diskspace ;;
124     "Display logged on users")
125         whoseon ;;
126     "Display memory usage")
127         menusage ;;
128     *)
129         clear
130         echo "Sorry, wrong selection" ;;
131     esac
132 done
133 clear
134 
135 #!/bin/bash
136 
137 
138 function menu {
139     clear
140     echo 
141     echo -e "\t\t\tSys Admin Menu\n"
142     echo -e "\t1. Display disk space."
143     echo -e "\t2. Display logged on users"
144     echo -e "\t3. Display memory usage"
145     echo -e "\t4. Exit Program\n\n "
146     echo -en "\t\t Enter option: "
147     read -n 1 option
148 }
149 menu
150 case $option in
151 0) 
152     break ;;
153 1)
154     diskspace ;;
155 2)
156     whoseon ;;
157 3)
158     menusage ;;
159 *)
160     clear
161     echo "Sorry, wrong selection" ;;
162 esac
test7

 

循环读取内容:

 

posted on 2019-05-25 13:25  微子天明  阅读(517)  评论(0编辑  收藏  举报

导航