Write scripts so that the/ETC/RC.D/RC3.D directory has multiple files starting with K and starting with S, output in the following format
K The beginning of the back plus stop
s starts with the back plus start
The code is as follows:
[[email protected] ~]# cat t1.sh#!/bin/bashfor file in $ (ls/etc/rc.d/rc3.d/);d OIF ["$ (echo $file |cut-c 1)" = = "S"];th enif [$ (echo $file |wc-c)-ge];thenecho-e "$file start" elif [$ (echo $file |wc-c)-ge];thenecho-e "$file \ t Start "Elif [$ (echo $file |wc-c)-ge 8];thenecho-e" $file \t\t start "Fielseif [$ (echo $file |wc-c)-ge];thenecho -E "$file stop" elif [$ (echo $file |wc-c)-ge];thenecho-e "$file \ t Stop" elif [$ (echo $file |wc-c)-ge 8];thenec Ho-e "$file \t\t Stop" Fifidone
The following results are performed:
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/78/DB/wKioL1aEI2HylQLzAABLKphuBDE398.png "title=" QQ picture 20151231023210.png "alt=" Wkiol1aei2hylqlzaablkphubde398.png "/>
Script Practice--001