shell编程100例(11~15)

shell脚本保姆级教程,附赠100个shell脚本案例! 无论是系统运维,还是应用运维,均可分为“**纯手工”—> “脚本化”—> “自动化”—>“智能化”**几个阶段,其中自动化阶段,主要是将一些重复性人工操作和运维经验封装为程序或脚本,一方面避免重复性操作及风险,另一方面提高执行效率。 在自动化运维的转变过程中,经常使用的可能就是shell脚本了。 很多人认为shell脚本简单,但其实Shell的小脚本却有大智慧。别小看几十行代码,它夹杂着系统设计、代码规范和操作经验等等细节,在建设自动化运维的工作中,还是很值得我们研究学习的。 为了帮助大. 阅读详情

11、石头、剪刀、布游戏`

#!/bin/bash
# 编写脚本,实现人机<石头,剪刀,布>游戏
game=(石头 剪刀 布)
num=$[RANDOM%3]
computer=${game[$num]}
# 通过随机数获取计算机的出拳
# 出拳的可能性保存在一个数组中,game[0],game[1],game[2]分别是 3 中不同的可能
 
echo "请根据下列提示选择您的出拳手势"
echo "1.石头"
echo "2.剪刀"
echo "3.布"
 
read -p "请选择 1‐3:" person
case  $person  in
1)
  if [ $num -eq 0 ]
  then
    echo "平局"
    elif [ $num -eq 1 ]
    then
      echo "你赢"
  else
    echo "计算机赢"
  fi;;
2)   
  if [ $num -eq 0 ]
  then
    echo "计算机赢"
    elif [ $num -eq 1 ]
    then
      echo "平局"
  else
    echo "你赢"
  fi;;
3)
  if [ $num -eq 0 ]
  then
    echo "你赢"
    elif [ $num -eq 1 ]
    then
      echo "计算机赢"
  else
    echo "平局"
  fi;;
*)
  echo "必须输入 1‐3 的数字"
esac

12、编写脚本测试 192.168.4.0/24 整个网段中哪些主机处于开机状态,哪些主机处于关机状态(for 版本)

#!/bin/bash
# 编写脚本测试 192.168.4.0/24 整个网段中哪些主机处于开机状态,哪些主机处于关机
# 状态(for 版本)
for i in {1..254}
do
	# 每隔0.3秒ping一次,一共ping2次,并以1毫秒为单位设置ping的超时时间
   	ping ‐c 2 ‐i 0.3 ‐W 1 192.168.4.$i  &>/dev/null
    if  [ $? -eq 0 ];then
       	echo "192.168.4.$i is up"
   	else
       	echo  "192.168.4.$i is down"
   	fi
done

13、编写脚本测试 192.168.4.0/24 整个网段中哪些主机处于开机状态,哪些主机处于关机状态(while 版本)

#!/bin/bash
# 编写脚本测试 192.168.4.0/24 整个网段中哪些主机处于开机状态,哪些主机处于关机
# 状态(while 版本) 
i=1
while [ $i -le 254 ]
do
   	ping ‐c 2 ‐i 0.3 ‐W 1 192.168.4.$i  &>/dev/null
   	if  [ $? -eq 0 ];then
       	echo "192.168.4.$i is up"
    else
       	echo  "192.168.4.$i is down"
   	fi
   	let i++
done

14、编写脚本测试 192.168.4.0/24 整个网段中哪些主机处于开机状态,哪些主机处于关机状态(多进程版)

#!/bin/bash
# 编写脚本测试 192.168.4.0/24 整个网段中哪些主机处于开机状态,哪些主机处于关机
# 状态(多进程版)
 
#定义一个函数,ping 某一台主机,并检测主机的存活状态
myping(){
ping ‐c 2 ‐i 0.3 ‐W 1 $1  &>/dev/null
if  [ $? -eq 0 ];then
	echo "$1 is up"
else
	echo "$1 is down"
fi
}
for i in {1..254}
do
   	myping 192.168.4.$i &
done
# 使用&符号,将执行的函数放入后台执行
# 这样做的好处是不需要等待ping第一台主机的回应,就可以继续并发ping第二台主机,依次类推。

15、编写脚本,显示进度条

#!/bin/bash
# 编写脚本,显示进度条
jindu(){
while :
do
   	echo -n '#'
   	sleep 0.2
done
}
jindu &
cp -a $1 $2
killall $0
echo "拷贝完成"

Shell脚本编程100例 Shell脚本编程100例。 融汇 shell 脚本知识点,集大成之作。 本书实在是学习、进修、面试、居家旅行必备精品! 立即下载

相关推荐

STM32实现webserver显示数据及配置参数

其实提到的将fsdata.c重命名为fsdata_custom.c,可以不重命令,将/LWIP/Target/lwipopts.h中HTTPD_USE_CUSTOM_FSDATA 定义为0,这样HTTPD_FSDATA_FILE将使用fsdata.c,避免每次生成fsdata.c需要重命令的麻烦。2、登录成功后,板卡根据板卡配置类型,返回对应的数据页面,该页面可实现数据校准、清零,以及进行到板卡参数设置页面。目前还未实现post功能以及http身份验证功能。3、板卡参数设置页面。

2693

shell编程100例

1、编写hello world脚本 2、通过位置变量创建 Linux 系统账户及密码 3、备份日志 4、一键部署 LNMP(RPM 包版本) 5、监控内存和磁盘容量,小于给定值时报警 6、猜数字游戏 7、检测本机当前用户是否为超级管理员,如果是管理员,则使用 yum 安装 vsftpd,如果不是,则提示您非管理员(使用字串对比版本) 8、检测本机当前用户是否为超级管理员,如果是管理员,则使用 yum 安装 vsftpd,如果不是,则提示您非管理员(使用 UID 数字对比版本)

Admans的专栏 2万+

Spring Authorization Server自定义密码模式:突破标准OAuth2限制,实现MFA与复杂业务集成

OAuth 2.0授权框架是构建现代应用安全体系的基石,其密码模式(Resource Owner Password Credentials Grant)提供了一种直接的资源所有者凭证交换令牌的机制。该模式的核心原理是客户端收集用户密码并直接向授权服务器请求访问令牌,适用于受信任的客户端场景。在技术价值上,它简化了某些传统应用的OAuth集成流程。然而,标准实现往往难以满足复杂的现实业务需求,例如需要集成多因素认证(MFA)、对接外部LDAP目录服务或执行自定义密码加密校验等场景。Spring Authori

weixin_34302561的博客 437

shell100例

shell100例

jackjack博客 5286

避开STM32H7的‘保护陷阱’:从Option Byte机制深度解析读写保护原理与预防

本文深度解析STM32H723VGT6的Option Byte保护机制,详细讲解RDP读保护和WRP写保护的工作原理及配置方法,并提供硬件设计防御策略和软件预防性编程技巧,帮助开发者避免误触发保护机制导致芯片锁定的问题。

weixin_33686714的博客 441

手把手教你用CEFSharp打造防关联指纹浏览器(附完整代码)

本文详细介绍了如何基于CEFSharp框架,从零开始构建一个企业级的防关联指纹浏览器。通过剖析核心架构、多进程隔离实现、动态指纹混淆(如Canvas、WebGL)的实战代码,以及代理集成与性能优化,为跨境电商、广告投放等场景提供了一套可控、安全的开源解决方案。

fern8的博客 961

100个实用的 Linux Shell 脚本经典案例,收藏备用~

点击关注公众号,利用碎片时间学习1)编写hello world脚本#!/bin/bash #编写helloworld脚本 echo"HelloWorld!"2)通过位置变量创建 Linux 系统账户及密码#!/bin/bash #通过位置变量创建Linux系统账户及密码 #$1是执行脚本的第一个参数,$2是执行脚本...

Java笔记虾 1万+

【YOLOv8系列】YOLOv8的webUI界面设计;通过Streamlit实现YOLOv8的可视化交互界面设计

但是我为了避免重复性的工作,且为了避免重复安装之前(安装pytorch和yolov8时)已经安装好的库,因此写了一个python脚本进行安装;需要提前在有网络连接的电脑上下载所有必要的依赖项,然后将这些文件传输到离线的机器上进行安装。脚本将自动跳过已安装的包,并安装其余的 .whl 文件。在离线的机器上,切换到包含下载好的文件的目录。证明我们的streamlit安装成功了。证明你的streamlit安装成功了。第一步:在有网络连接的电脑上下载。第二步:将下载的文件传输到离线机器。文件)传输到离线的机器上。

AnChenliang_1002的博客 1566

shell脚本100例

判断文件或目录是否存在 #!/bin/bash if [ $# -eq 0 ] ;then echo “未输入任何参数,请输入参数” echo “用法:$0 [文件名|目录名]” fi if [ -f $1 ];then echo “该文件,存在” ls -l $1 else echo “没有该文件” fi if [ -d $1 ];then echo “该目录,存在” ls -ld $2 else echo “没有该目录” fi 无密码登录虚拟机系统 #!/bin/bash #该脚本使用 gues.

weixin_49994404的博客 3596

YOLO26改进目录一览 | 涉及卷积层、轻量化、注意力、损失函数、Backbone、SPPF、Neck、检测头等全方位改进

1️⃣ 什么!不知道如何改进模型⁉️ 本专栏已更新260多种不同的改进方法,所使用并改进的每一个模块均包含详细的模块分析、原理讲解、个人总结、多种改进方式以及完整的修改流程,所有改进100%可直接运行,性价比极高。2️⃣ 找不到合适的模块⁉️ 所有改进点均为近三年顶会,顶刊提出的先进算法,将其融入到中,并进行二次创新,新颖度高,创新度高,能够适应不同的任务场景。3️⃣ 不确定自己改进的步骤、结果是否正确⁉️ 订阅专栏即可进群享受模型训练、模型改进、论文写作、投稿选刊,从入门到论文的各种答疑内容,非常适合新手

Limiiiing的博客 6359

SpringBoot系列之实现一个AI聊天助手

本文介绍了基于Spring Boot框架实现的AI聊天助手项目。该项目使用Spring Boot 3.2.3、Spring AI 1.0.0-M5等技术栈,集成DeepSeek-R1-Distill-Llama-8B模型实现智能对话功能。文章详细介绍了项目配置流程、运行方式和核心代码实现,包括ChatMessage模型类和服务类ChatService的关键功能,如消息处理、历史记录管理和AI响应获取等。读者可通过提供的GitHub链接获取完整代码,快速搭建自己的AI聊天应用。

Nicky's blog 1451

101个shell脚本

本文用于记录学习和日常中使用过的shell脚本 【脚本1】打印形状 打印等腰三角形、直角三角形、倒直角三角形、菱形 #!/bin/bash # 等腰三角形 read -p "Please input the length: " n for i in `seq 1 $n` do for ((j=$n;j>i;j--)) do echo -n " " done ...

weixin_34337381的博客 1万+

【异常】安装hermes-agent提示Git克隆仓库网络中断 fetch-pack: unexpected disconnect while reading sideband packet

本文分析了Git克隆仓库时出现网络中断错误的常见原因及解决方案。报错表现为连接被远程主机关闭、管道破裂或数据包意外终止,通常由网络不稳定、仓库过大或配置不当引起。提供了5种优先级排序的解决方法:1)使用浅克隆减少数据量;2)优化Git配置参数;3)切换网络或配置代理;4)检查SSH密钥设置;5)改用HTTPS方式克隆。特别推荐先尝试「浅克隆+HTTPS」组合方案快速验证,若问题持续再根据具体报错深入排查。文中包含详细的命令示例和配置说明,适合不同网络环境下的Git用户参考。

奶爸的编程之路,也就一周冷个三天 1418

shell脚本快速入门之-----shell脚本练习100例!!!

#!/bin/bash i=1 for i in {1..254} do ping -c 2 -w 3 -i 0.3 192.168.110.$i $> /dev/null if [ $? -eq 0 ] ;then echo "192.168.110.$i is yes" else echo "192.168.110.$i is no" fi let i++ done

weixin_47219935的博客 1万+

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

shell编程100例(10-15)

11、9*9 乘法表 #!/bin/bash 99 乘法表(编写 shell 脚本,打印 99 乘法表) for i in seq 9 do for j in seq $i do echo -n "j∗j*j∗i=$[i*j] " done echo done 12、编写脚本测试 192.168.4.0/24 整个网段中哪些主机处于开机状态,哪些主机处于关机状态(for 版本) #!/bin/b...

Sunlightljj的博客 281

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

shell编程100例(11-15)

11、石头、剪刀、布游戏 #!/bin/bash 编写脚本,实现人机<石头,剪刀,布>游戏 game=(石头 剪刀 布) num=[RANDOMcomputer=[RANDOM%3] computer=[RANDOMcomputer={game[$num]} 通过随机数获取计算机的出拳 出拳的可能性保存在一个数组中,game[0],game[1],game[2]分别是 3 中不同的可能...

changdizm的博客 280

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Linux 实验 —— shell 编程

1、 查看当前系统下用户 shell 定义的环境变量的值。 2、 定义变量 AK 的值为 200,并将其显示在屏幕上。 3、 定义变量 AM 的值为 100,并使用 test 命令比较其值是否大于 150。 4、 创建一个简单的 shell 程序,其功能为: 1) 将主机名改为你的名字汉语拼音字母; 2) 显示计算机主机名以及显示系统日期和时间。 5、 使用 if-then-else 语句创建一个根据输入的分数判断分数是否及格的 shell 程序。 6、 使用 for 语句创建求命令行上所有整数之和的 sh

wujy的专栏 1万+

15 SHELL脚本编程进阶

SHELL脚本编程进阶 循环 for;while 信号捕捉 函数 判断操作系统版本的函数;判断Y|N的函数 数组 高级字符串操作 高级变量 expect for–适用于数字和序列 常用便利列表 [root@CentOS8 ~]#sum=0;for i in {1..100};do let sum+=i;done;echo $sum 5050 [root@CentOS8 ~]#for i in...

YANYI99的博客 1054

100 个必须要学会的 Linux Shell 命令

telnet 192.168.11.24 8080 – 查看地址 192.168.11.24 8080 是否可以被访问wget。

2401_86790369的博客 2406

3、Shell基本编程 - 看这一篇就够了

目录三、Shell基本编程1、Shell编程介绍2、Shell脚本基本结构3、Shell脚本及运行4、Shell变量及表达式 - 变量类型5、常用的Shell预定义变量6、Shell变量及表达式 - 位置参数7、Shell变量及表达式 –缺省参数8、Shell变量表达式 概述9、Shell脚本流程控制 - 分支语句if10、Shell脚本流程控制 - 分支语句case11、Shell脚本流程控制—...

拒绝刘亦菲的博客 9276

Shell编程

1.Shell编程 2.bash 和 sh的关系 **sh 是bash的快捷方式** 3.创建一个 .sh文件 权限不够怎么办 chmod 777 a.sh修改权限即可 4shell变量 4.1 在shell脚本中, 定义变量时,变量名不加美元符号($),如: your_name="runoob.com" 注意 : 变量名和等号之间不能有空格,这可能和你熟悉的所有编程语言都不一样。 同时,变量名的命名须遵循如下规则: 命名只能使用英文字母,数字和下划线,首个字符不能以

qq_45769990的博客 1万+

shell实例100例《六》

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34235457的博客 606

shell例题-15道来自牛客网

题目描述 写一个 bash脚本以统计一个文本文件 nowcoder.txt中字母数小于8的单词。 示例:假设 nowcoder.txt 内容如下: how they are implemented and applied in computer 你的脚本应当输出: how they are and applied in 说明:不要担心你输出的空格以及换行的问题 cat nowcoder.txt | awk '{ for (i=1;i<=NF;i++){ if ..

wnccmyr的博客 1756

用shell编程求C语言1到100,shell脚本快速入门之-----shell脚本练习100例!!!

文章目录1、循环ping192.168.110网段的所有主机2、for批量创建用户3、创建存放1-100奇数的数组里创建任意数字及长度的数组,根据客户的需求加入元素4、将一个数组中的所有不够60的提到605、判断数组中最大的数6、 猜数字游戏7 检测本机当前用户是否为超级管理员,如果是管理员,则使用 yum 安装 vsftpd,如果不是,则提示您非管理员(使用字串对比版本)8编写脚本,实现人机游戏...

weixin_39693101的博客 1407

shell编程,实战高级进阶教学

shell编程从入门到高级教程 一.shell编程初识 1.1 shell能做什么 1. 自动化批量系统初始化程序 (update,软件安装,时区设置,安全策略...) 2. 自动化批量软件部署程序 (LAMP,LNMP,Tomcat,LVS,Nginx) 3. 应用管理程序 (KVM,集群管理扩容,MySQL,DELLR720批量RAID) 4. 日志分析处理程序(PV, UV, 200, !200, top 100, grep/awk) 5. 自动化备份恢复程序(MySQL完全备份/增量 +...

mingriqiufeng的博客 1万+
上一篇: demo.sh(批量添加及删除老师和学生用户)
下一篇: Linux网络编程和C++笔记
闪烁丶星空
博客等级 码龄7年 13粉丝 19原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值