- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 基于key验证的多主机相互访问
选一台主机生成公钥和私钥对ssh-keygen -t rsa -P '' -f "~/.ssh/id_rsa"在当前主机复制公钥,生成 authorized_keys 文件ssh-copy-id 192.168.56.101将此主机的整个 .ssh 目录复制到其他主机上#!/bin/bashuser=$2password=$3while read ip;doexp...
2019-03-25 16:35:44 131
原创 马哥教育N36第六周作业
1. 100.0.0.16/28 对应网段的网关地址、广播地址、可分配IP地址范围网络地址是 100.0.0.16广播地址是 100.0.0.31可分配地址范围是 100.0.0.17–100.0.0.302. 使用man手册学习tcpdump的使用tcpdump是用于转存网络上的数据流。语法格式如下:tcpdump [option…] [expression]常用选项含...
2019-03-09 11:20:19 228
原创 数组练习
1.输入若干个数值存入数组中,采用冒泡算法进行升序或降序排序#!/bin/bashdeclare -a numberfor (( i=0; i<20; i++ ));do number[$i]=$RANDOMdoneecho "before sort:"echo ${number[@]}declare -i n=20for (( i=0; i<
2019-03-04 16:58:43 394
原创 while和until循环练习
1.用二个以上的数字为参数,显示其中的最大值和最小值#!/bin/bashif [[ $# == 0 ]];then echo "no arguments" exitfideclare -i biggest=$1declare -i smallest=$1until [[ -z $1 ]];do if (( $1 > $biggest ));then big...
2019-03-01 16:16:49 529
原创 编写shell脚本,实现打印国际象棋棋盘
代码如下:#!/bin/bash#set chess cell's widthread -p "Please set the chess cell's width( two space width as unit ):" widthif [[ $width =~ "^[0-9]+$" ]];then echo "wrong width setting, check your inpu...
2019-03-01 09:29:33 1672
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人