随笔分类 -  Bash

摘要:1 #!/bin/env sh 2 3 function bb(){ 4 declare -i p=1 5 until [ $p -gt $1 ];do 6 declare -i z=1 7 until [ $z -gt $p ];do 8 echo -ne "${z}X${p}=$[z*p]\t" 阅读全文
posted @ 2020-05-26 20:20 ascertain 阅读(409) 评论(0) 推荐(0) 编辑
摘要:#!/bin/env sh program=`basename $0|awk -F. '{print $1}'` lock=/var/lock/subsys/$program source /etc/rc.d/init.d/functions function start(){ if [ -e $l 阅读全文
posted @ 2020-05-26 19:11 ascertain 阅读(141) 评论(0) 推荐(0) 编辑
摘要:bash中即使declare -x或export的变量,子shell可以引用和改变,但是该改变无法作用到父shell中. 阅读全文
posted @ 2020-05-26 10:50 ascertain 阅读(138) 评论(0) 推荐(0) 编辑
摘要:1 #!/bin/env sh 2 3 declare -i p z 4 5 for ((p=1;p<=9;p++));do 6 for ((z=1;z<=p;z++));do 7 echo -e "${z}X${p}=$[p*z]\t\c" 8 done 9 echo 10 done 11 12 阅读全文
posted @ 2020-05-25 19:23 ascertain 阅读(171) 评论(0) 推荐(0) 编辑
摘要:#!/bin/env sh source /etc/rc.d/init.d/functions declare -i p=1 declare -i online=0 declare -i offline=0 net='192.168.8' while [[ $p -le 10 ]];do ping 阅读全文
posted @ 2020-05-25 18:59 ascertain 阅读(431) 评论(0) 推荐(0) 编辑
摘要:1 #!/bin/env bash 2 3 declare -i max min 4 declare -a mm 5 6 for z in `seq 1 1 10`;do 7 if [[ $z -eq 1 ]];then 8 max=min=$RANDOM 9 mm[$z]=$max 10 cont 阅读全文
posted @ 2020-05-25 18:13 ascertain 阅读(1743) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示