码迷,mamicode.com
首页 > 其他好文 > 详细

第六周重点

时间:2019-11-04 09:33:06      阅读:67      评论:0      收藏:0      [点我收藏+]

标签:redhat   chroot   bio   ase   大于   kernel   变量   success   bios   

循环脚本
sum=0;
for i in {1..100};do
let sum+=i;
done
echo $sum

sum=0
i=1
while [ $i -le 100 ];do
let sum+=i
let i++
done
echo $sum

for ((sum=0,i=0;i<=100;i++));do
let sum=i;
done
echo $sum
let后面不用加变量符号 -eq相等 -ne不等 -gt大于 -lt小于 -ge大于等于 -le小于等于

for i in {1.10};do useradd user$i;
echo centos|passwd --stdin user$i &> /dev/null ;passwd -e user$i;done

for i in {1..10};do userdel -r user$i;done

for i in cat userlist.txt;do
useradd $i
echo centos|passwd --stdin $i &> /dev/null
echo $i is created
done

99表
for i in {1..9};do
for j in seq $i;do
echo -e "$[j]$[i]=$[ij]\t\c"
done
echo
done

for((i=1;i<=9;i++));do
for((j=1;j<=i;j++));do
echo -e "$[i]$[j]=$[ij]\t\c"
done
echo
done

i=1
while [ $i -le 9 ];do
j=1
while [ $j -le $i ];do
echo -e "$[i]$[j]=$[ij]\t\c"
let j++
done
let i++
echo
done

sum=0
i=1
while [ $i -le 100 ];do
[ $[i%2] -eq 1 ] && let sum+=i 
let i++
done 
echo $echo

sum=0
i=1
while [ $i -le 100 ];do 
RESULT=$[i%2]
if [ $RESULT -eq 0 ];then
 let i++
 continue
 else
 let sum+=i 
 let i++
 fi
 done 

for ((i=0;i<=10;i++));do
if [ $i -eq 5 ];then continue;fi
echo $i
done
echo continue

for((i=;i<=10;i++));do
if [ $i -eq 5 ];then break;fi
echo $i*jdone
echo break

for ((i=0;i<10;i++));do
for ((j=0;j<10;j++));do
if [ $j -eq ];then continue 2;fi
echo j=$j
done
echo i=$i
done
echo continue

for ((i=0;i<10;i++));do
for ((j=0;j<10;j++));do
if [ $j -eq 5 ];then break;fi
echo j=$j
done
echo i=$i
done
echo continue

while [ "$1" ];do
useradd $1
echo $1 is created
shift
done

for i in a b c / ;do userdel -r $i;done

echo a b c | { read i j k;echo i=$i;echo j=$j;echo k=$k; }
echo a b c |while read i;do echo i=$i;done
df|sed -nr ‘/^\/dev\/sd/s#^([^ ]+) . ([0-9]+)%.#\1 \2#p‘

WARNING=10
2 df|sed -nr ‘/^\/dev\/sd/s#^([^ ]+) . ([0-9]+)%.#\1 \2#p‘|while read DEV USE;do
3 if [ $USE -ge $WARNING ]; then
4 echo warning
5 fi
6 done

while read user;do useerdel -r $suer;done < userlist.txt

while read USER PASS;do
useradd $USER
echo $PASS|passwd --stdin $USER &> dev/null
echo ‘$USER is created‘
done < user.txt

cat<<!
1)
2
3)

while read MENU;do
case $MENU in
1)
echo The price is 100
;;
2)
echo The price is

1 osversion () {
2 sed -nr ‘s/. ([0-9]+)../\1/p‘ /etc/redhat-release
3 }
4 osversion

cd /etc/init.d . functions action "excute successful"

10.30
trap ‘echo press ctrl+c‘ int
trap -p
for ((i=0;i<=10;i++));do
echo $i
sleep 1
trap ‘‘ 2
trap -p
for ((i=10;i<10;i++));do
echo $i
sleep 1
done

linux启动及管理服务

启动流程
linux 内核:
核心文件; /boot/vmlinuz-VERSION-release
centos6,7 /boot/initramfs-VERSION-release.img
模块文件; /lib/modules/VERSION-release

为当前正在使用的内核重新ramdisk文件
mkinitrd /boot/initramfs-$(uname -r).img$(uname -r)
init 初始化 /etc/inittab
centos7 配置文件; /usr/lib/systemd/system
/etc/systemd/system

chkconfig --list
 xinetd   grub启动

 centos6 启动流程
 POST-->Boot sequence(BIOS)-->boot loader-->kernel-->rootfs-->
 switchroot--> /sbin/init-->(/etc/inittab, /etc/init/*.conf)-->
 设定默认运行级别-->
grub legacy:  stage1:mbr stage1_5:mbr之后的扇区,让stage1中bootloader
能识别stage2所在的分区上的文件系统
stage2:磁盘分区(/boot/grub/)

第六周重点

标签:redhat   chroot   bio   ase   大于   kernel   变量   success   bios   

原文地址:https://blog.51cto.com/14319741/2447438

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!