Shel简介入门

Shell编程:
1.了解入门
2.变量 变量子串知识
3.特殊位置变量
4.脚本的执行方式
5.脚本传参
6.数值运算
7.数值比较
8.字符串比较
9.正则比较方式
10.条件控制语句
   if
   while
   for
   case
   break
   continue
   exit
11.数组
12.案例

一. Shell介绍
Shell的作用
系统服务的启动脚本 服务管理方式使用shell编程
脚本作用: 减少重复性工作
1)安装操作系统 通过cobbler kickstart批量自动化安装工具 批量安装操作系统 底层使用Shell编程
2)操作系统优化 优化内容:
  a.修改ssh默认连接端口 禁止DNS解析 禁止root远程登录 创建普通用户 jumpserver
  b.加大文件描述符 最大文件打开数量
  c.时间同步
  d.关闭Selinux
  c.关闭NetworkManger
  f.优化firewalld防火墙
  g.修改默认的YUM仓库为国内速度较快的仓库 安装epel源
  h.安装常用的命令软件
  内核层面优化
  通过脚本进行系统优化CentOS6.x CentOS7.x
3)安装部署服务
  需求: 每天安装的PHP版本不同 5.4 7.1 7.2
  通过脚本部署不同的PHP(服务)版本
  1. PHP5.4
  2. PHP7.1
  3. PHP7.2
  请选择安装的版本: 2
  
4)服务优化 通过脚本优化(Ansible)
5)启动服务 通过Shell脚本启动
  企业自己研发 自研程序
  使用python写了一个业务程序 运行程序
  cat test.sh
  nohup python test.py --mysql-ip --mysql-ip --mysql-user= --mysql-password=  &
  nohup python test.py --mysql-ip --mysql-ip --mysql-user= --mysql-password=  &
  nohup python test.py --mysql-ip --mysql-ip --mysql-user= --mysql-password=  &
  sh test.sh start
  sh test.sh stop
  
  [root@shell ~]# ps axu|grep 1.sh|grep -v grep|awk '{print $2}'|xargs kill -9

6)日志管理 
  ELK 通过Shell脚本处理日志
  日志切割(防止日志单个文件容量过大)
  1. mv 移动
  2. 重载服务
  3. 日志统计分析
7)监控
     zabbix
           底层硬件 磁盘  内存 IO 网络 负载 风扇转速 温度 湿度
           系统运行状态 日志情况 系统日志 登录日志 
           系统服务运行状态 端口 PID方式 Nginx状态 PHP状态 MySQL状态
           系统服务状态码1天的状态码 访问URL次数
           业务层面 api接口 业务数据
           取值---->监控
8)处理重复性问题 脚本+定时任务
9)通过脚本对接业务 实现业务功能(大保健 点餐案例)

二. 学习Shell必须掌握的知识
1)远程连接工具xshell crt
2)基础命令  常用命令必须掌握60个左右
3)vim快捷键 快捷方式 vim是vi的高级版本
4)awk sed grep find
  awk -F "-:."  "[-:.]+"


三. 如何学好Shell编程
1)掌握必会知识点
2)掌握Shell基础部分
  变量
  数值运算
  整数比较
  字符串比较
  文件判断
  正则比对
3)Shell语法结构
  if [ ]
  for
  case
  while
  数组
4)能读懂 能修改 独立书写小的案例 多花时间(购买老男孩Shell编程)

5)不要看着感觉会了 切记拿来既用(模仿)

 
四. 什么是Shell
1)命令解释器
  Linux操作系统默认的解释器是: bash
  交互式:    和人交互   人输入命令 解释器解释 返回结果给人
  非交互式   执行shell脚本

2)什么是Shell脚本
  命令的集合
  将可执行命令写入文本中(并且脚本中包含变量 判断 循环等语句) 文本称为shell脚本

    Shell语法: 解释型语言 脚本语言 执行一次解释一次  慢
    C语言:     编译型语言 一次编译终身执行             快

    python go ruby html java javascript

    Shell和python区别
    Shell处理底层 启动 停止 优化 统计数据
    Python处理数据 页面CMDB运维平台 日志统计平台 

五. Shell脚本的规范
   1)shell脚本必须以.sh结尾 给我们自己看的
   2)脚本的以#!/bin/bash或者 #!/bin/sh开头 指定shell解释器
   3)Shell存放位置统一 
     [root@shell ~]# mkdir /server/scripts -p
   4)脚本尽量写注释信息
    脚本作用 脚本作者 脚本版本号(和业务对应) 脚本创建时间
   5)成对的符号和语句一次性书写完毕 注意中英文问题
    '' "" `` [] {} [[[]] {{}} . <>
    ‘’ “” ·· 【】 。《》
   6)脚本注释尽量不用中文

六. 第一个Shell脚本
    [root@shell scripts]# cat test.sh
    #!/bin/bash
    echo "Hello World!!"

执行脚本的方式:
第一种执行方式: 使用sh或者bash执行
    以子shell方式运行
    [root@shell scripts]# sh test.sh 
    Hello World!!
    [root@shell scripts]# bash test.sh 
    Hello World!!
    [root@shell ~]# sh /server/scripts/test.sh 
    Hello World!!

第二种执行方式: 使用路径方式执行 需要执行x权限
    以子shell方式运行
相对路径:./
    [root@shell scripts]# ./test.sh
    -bash: ./test.sh: Permission denied
    [root@shell scripts]# chmod +x test.sh 
    [root@shell scripts]# ll
    total 4
    -rwxr-xr-x 1 root root 33 Aug  1 11:22 test.sh
    [root@shell scripts]# ./test.sh
     Hello World!!


绝对路径:    
   [root@shell ~]# /server/scripts/test.sh 
    Hello World!!

    
第三种执行方式: 使用. 或者source执行
在父shell中执行
[root@shell scripts]# . test.sh
Hello World!!
[root@shell scripts]# source test.sh
Hello World!!


第二种执行方式和第三种执行方式的区别:
使用sh或者bash执行:
[root@shell scripts]# cat test.sh
#!/bin/bash
echo "Hello World!!"
name=oldboy
[root@shell scripts]# sh test.sh
Hello World!!
[root@shell scripts]# echo $name

[root@shell scripts]# 

使用source执行:
[root@shell scripts]# source test.sh 
Hello World!!
[root@shell scripts]# echo $name
oldboy

脚本的其他执行方式:

[root@shell scripts]# cat test.sh 
#!/bin/bash
echo "Hello World!!"
name=oldboy
[root@shell scripts]# cat test.sh |bash
Hello World!!


[root@shell scripts]# echo pwd
pwd
[root@shell scripts]# echo pwd|bash
/server/scripts


[root@shell scripts]# sh < test.sh
Hello World!!

七.变量
1)什么是变量?  x=1 y=x+1
用一个固定的值来表示任意不固定的值称为变量
例如:
name=oldboy
age=18

变量的分类:
环境变量(全局变量) 对所有bash生效
普通变量(局部变量) 只对当前的bash生效

全局变量: 系统默认的变量  为了满足用户正常使用操作系统定义的
         PATH
         PS1
         LANG
普通变量: 用户自定义变量 常用变量(写在脚本中的变量 只针对脚本生效)
查看全局变量: env

2)变量相关的配置文件
第一种方式: 按照开机启动加载文件的顺序排序
  1. /etc/profile
  2. .bash_profile
  3. .bashrc
  4. /etc/bashrc
 
第二种方式: 按照生效顺序排序
  最后一个执行的就是优先生效的 称为重复赋值
  1. /etc/bashrc
  2. .bashrc
  3. .bash_profile
  4. /etc/profile

3)变量按照生命周期划分:
永久变量: 写入配置文件 写入脚本的
        /etc/profile
        test.sh
临时变量: 使用export声明即可
        在当前命令行测试的变量
        变量加export和不加export的区别:
        加export对当前窗口的所有bash生效
        不加export值针对当前的bash生效


笔试题:
执行以下脚本结果为: 空
[root@shell ~]# cat test.sh
oldboy=`whoami`
[root@shell ~]# sh test.sh
[root@shell ~]# echo $oldboy

4)变量名的定义方式
  1. 名称见名知其意
  2. 名称只能以下划线和字母开头 不能以数字和-开头
  3. 等号的两端不允许有空格
  4. 名称的书写方式:
     NAME_AGE=    # 全部大写 系统变量名称默认全部大写的
     name_age=    # 全部小写
     Name_Age=    # 单词的首字母大写 大驼峰语法
     name_Age=    # 小驼峰语法
  
临时取消变量:
[root@shell ~]# unset name

5)变量值的定义方式
第一种: 值为字符串 
特点:
     连续的字符串
     如果不连续需要用引号括起来
     双引号  可以解析变量
     单引号  不解析变量 所见即所得
    name=oldboy
变量调用变量:
    [root@shell ~]# name=oldboy
    [root@shell ~]# test='$name_age'
    [root@shell ~]# echo $test
    $name_age
    [root@shell ~]# test="$name_age"
    [root@shell ~]# echo $test

    [root@shell ~]# test="${name}_age"
    [root@shell ~]# echo $test
    oldboy_age
    [root@shell ~]# test='${name}_age'
    [root@shell ~]# echo $test
    ${name}_age
 
    案例: 字符串定义
    定义代码路径


第二种: 值为数字
   特点:
        连续的数字
    [root@shell ~]# age=12 323
    -bash: 323: command not found
    [root@shell ~]# age=12323
    [root@shell ~]# age='12 3 2  3'
    [root@shell ~]# echo $age
    12 3 2 3

第三种: 值为命令
    如果值为命令必须加反引号或者$()
    [root@shell ~]# test=`ls`
    [root@shell ~]# echo $test
    1 data.txt passwd test.sh

    [root@shell ~]# date +%F-%H-%M-%S
    2022-08-01-15-20-38
    [root@shell ~]# time=`date +%F-%H-%M-%S`
    [root@shell ~]# echo $time
    2022-08-01-15-20-53
    [root@shell ~]# echo $time
    2022-08-01-15-20-53
    [root@shell ~]# time=`date +%F-%H-%M-%S`
    [root@shell ~]# echo $time
    2022-08-01-15-22-00

    需求: 每次调用time变量让时间发生变化
    [root@shell ~]# cat test.sh
    time='date +%F-%H-%M-%S'
    echo `$time`
    sleep 5
    echo `$time`
    sleep 5
    echo `$time`
    [root@shell ~]# sh test.sh
    2022-08-01-15-25-37
    2022-08-01-15-25-42
    2022-08-01-15-25-47

八. 特殊位置变量
   $0  表示脚本的名称 如果全路径执行则带全路径  *****
   $n  表示脚本的第n个参数 从$1开始 表示第1个参数  $10 $11双数以上需要使用{}括起来为一个整体 *****
   $#  表示脚本传参的个数                                      *****
   $*  表示脚本传参的参数 在使用循环语法不同 加双引号   了解  **
   $@  表示脚本传参的参数 在使用循环语法不同            了解  **
   $$  获取脚本的PID                                    **
   $!  获取上一次在后台执行脚本的PID号 脚本测试使用  调试脚本使用 ***
   $_  获取最后的字符串                                     了解     **
   $?  获取上一次执行命令的结果 0为成功 非0失败                           *****
   
   
$0 输出脚本名称
[root@shell scripts]# cat test.sh
#!/bin/bash
echo $0
[root@shell scripts]# sh test.sh
test.sh
[root@shell scripts]# cd
[root@shell ~]# sh /server/scripts/test.sh 
/server/scripts/test.sh

案例: 提示用户使用方法
[root@shell scripts]# cat test.sh
#!/bin/bash
name=oldboy
echo "Usage: $0 [start|stop|restart|reload|status]"
[root@shell scripts]# sh test.sh
Usage: test.sh [start|stop|restart|reload|status]
[root@shell scripts]# 

单独取脚本名称:
[root@shell ~]# basename /server/scripts/test.sh
test.sh
[root@shell ~]# basename /etc/sysconfig/network-scripts/ifcfg-eth0
ifcfg-eth0

$n 表示脚本的第n个参数
[root@shell scripts]# cat test.sh
#!/bin/bash
name=$1
age=$2
echo $name $age
[root@shell scripts]# sh test.sh oldboy 20
oldboy 20

序列传参
[root@shell scripts]# cat test.sh
#!/bin/bash
echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11}
[root@shell scripts]# sh test.sh {a..z}
a b c d e f g h i j k


$# 控制用户传参的个数
[root@shell scripts]# cat test.sh
#!/bin/bash
[ $# -ne 2 ]  && echo "必须传两个参数" && exit
echo $1
echo $2
[root@shell scripts]# sh test.sh
必须传两个参数
[root@shell scripts]# sh test.sh oldboy
必须传两个参数
[root@shell scripts]# sh test.sh oldboy 18 test
必须传两个参数
[root@shell scripts]# sh test.sh oldboy 18
oldboy
18


$* $@ 获取传参的所有的参数
在循环中加双引号有区别
[root@shell ~]# set -- "I am" lizhenya teacher
[root@shell ~]# echo $*
I am lizhenya teacher
[root@shell ~]# echo $@
I am lizhenya teacher
[root@shell ~]# for i in "$*";do echo $i;done
I am lizhenya teacher
[root@shell ~]# for i in "$@";do echo $i;done
I am
lizhenya
teacher


案例: 将ping的结果定向到空
      通过$?判断网站是否能ping通
      
        [root@shell scripts]# cat ping.sh
        #!/bin/bash
        ping -c1 -W1 $1 &>/dev/null
        [ $? -eq 0 ] && echo "$1 ok" || echo "$1 error"
        [root@shell scripts]# sh ping.sh www.baidu.com
        www.baidu.com ok
        [root@shell scripts]# sh ping.sh www.baiduddd.com
        www.baiduddd.com ok
        [root@shell scripts]# sh ping.sh www.baiducccc.com
        www.baiducccc.com error

九. 变量子串知识
1)变量的切片
[root@shell ~]# test="I am lizhenya"
[root@shell ~]# echo $test
I am lizhenya
[root@shell ~]# echo ${test:2:3}
am
[root@shell ~]# echo ${test:3:3}
m l

2)统计字符串的长度 笔试题
第一种方式:
[root@shell ~]# echo $test|wc -L
13
第二种方式:
[root@shell ~]# expr length "${test}"
13

第三种方式:
[root@shell ~]# echo $test|awk '{print length}'
13

第四种方式: 子串知识统计
[root@shell ~]# echo ${#test}
13

笔试题: 取出字符串小于3的单词
    [root@shell ~]# echo $test
    I am lizhenya I am 18

    [root@shell ~]# cat test.sh
    #!/bin/bash
    for i in I am lizhenya I am 18
    do
        echo ${#i}
    done
    [root@shell ~]# sh test.sh
    1
    2
    8
    1
    2
    2
第一种方式: 使用for循环+判断
    [root@shell ~]# cat test.sh
    #!/bin/bash
    for i in I am lizhenya I am 18
    do
        [ ${#i} -gt 3 ] && echo $i
    done
    [root@shell ~]# sh test.sh
    lizhenya

第二种方式: 通过awk判断
    [root@shell ~]# echo $test|xargs -n1|awk '{if(length<3)print}'
    I
    am
    I
    am
    18
    [root@shell ~]# echo $test|xargs -n1|awk '{if(length>3)print}'
    lizhenya

awk进阶方式:
    [root@shell ~]# echo $test
    I am lizhenya I am 18
    [root@shell ~]# 
    [root@shell ~]# echo $test|awk '{for(i=1;i<=NF;i++)if(length($i)>3)print $i}'
    lizhenya
    [root@shell ~]# echo $test|awk '{for(i=1;i<=NF;i++)if(length($i)<3)print $i}'
    I
    am
    I
    am
    18

笔试题: 取出文章中所有的字母 并且统计出现的次数
        取出文件中所有的单词 并且统计单词出现的次数
        

3)变量子串删除
  从前往后删除使用#  ## 贪婪匹配
    [root@shell ~]# echo $url
    www.baidu.com
    [root@shell ~]# echo ${url#www.}
    baidu.com
    [root@shell ~]# echo ${url#*.}
    baidu.com
    [root@shell ~]# echo ${url#*.baidu.}
    com
    [root@shell ~]# echo ${url#*.*.}
    com
    [root@shell ~]# echo ${url##*.}
com

    从后往前删除使用%  %% 贪婪匹配
    [root@shell ~]# echo ${url%.*}
    www.baidu
    [root@shell ~]# echo ${url%.*.*}
    www
    [root@shell ~]# echo ${url%%.*}
    www


    案例: 获取磁盘使用率 使用子串删除%
    [root@shell ~]# df -h|grep /$|awk '{print $(NF-1)}'
    11%
    [root@shell ~]# use_disk=`df -h|grep /$|awk '{print $(NF-1)}'`
    [root@shell ~]# echo $use_disk
    11%
    [root@shell ~]# echo $use_disk
    11%
    [root@shell ~]# echo ${use_disk%\%}
    11


4)变量子串替换
    替换使用//  贪婪匹配使用///
    [root@shell ~]# echo $url
    www.baidu.com
    [root@shell ~]# echo ${url/w/a}
    aww.baidu.com
    [root@shell ~]# echo ${url/ww/aa}
    aaw.baidu.com
    [root@shell ~]# echo ${url/w/aa}
    aaww.baidu.com
    [root@shell ~]# echo ${url/baidu/sina}
    www.sina.com
    [root@shell ~]# echo ${url/w/W}
    Www.baidu.com
    [root@shell ~]# echo ${url//w/W}
    WWW.baidu.com


小结:
1. 脚本的执行方式
  sh  bash
  source .
  ./script 路径方式执行
  cat test.sh|bash
  bash < test.sh
  
2. 变量定义
   字符串定义
   数值定义
   命令定义(反引号和单引号使用方式) 时间案例
   双引号和单引号的区别
   永久变量写入/etc/profile  针对全局生效
   脚本中定义普通变量 局部变量
   临时变量export
   
3. 特殊位置变量
   $0 $n $# $?  
   $$ $! $_ $* $@ 了解
   
4. 变量子串
   笔试题 切片 awk取值
   统计字符串的长度
   统计字符串小于3的单词
   
   了解: 子串删除 替换
   
   
   
下次内容:
1. 变量的传参方式
2. 数值运算
3. 条件表达式
   整数比较
   多整数比较
   字符串比较
   正则比较
   


   

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/86505.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

计算机视觉: 三维物体生成

三维物体生成与编辑 论文地址: Controllable Mesh Generation Through Sparse Latent Point Diffusion Models 背景 数据是目前数字化和AI领域最宝贵的财富之一&#xff0c;但是对于目前的开发者来说&#xff0c;收集数据都意味着极大的成本。所以建立一个高效的生成模型能极…

关于亚马逊云科技云技能学习

云计算作为当今信息技术领域的热门话题&#xff0c;正以其强大的计算和存储能力&#xff0c;灵活性和可扩展性&#xff0c;逐渐改变着人们的工作方式和生活方式。而其中的一家龙头企业——亚马逊云科技&#xff08;Amazon Web Services&#xff0c;AWS&#xff09;&#xff0c;…

用Bosch Sensortec的BMI08X传感器API在C语言中控制IMU传感器:一个完整的集成指南

介绍 在现代的硬件开发领域&#xff0c;惯性测量单元(IMU)已经成为了一个关键的组件&#xff0c;尤其在运动追踪和定位应用中。Bosch Sensortec 的 BMI08X 是其中的一种高度受欢迎的IMU系列传感器。为了更简单、更快速地在C语言项目中集成和使用这些传感器&#xff0c;Bosch S…

数据结构-----堆(完全二叉树)

目录 前言 一.堆 1.堆的概念 2.堆的存储方式 二.堆的操作方法 1.堆的结构体表示 2.数字交换接口函数 3.向上调整&#xff08;难点&#xff09; 4.向下调整&#xff08;难点&#xff09; 5.创建堆 6.堆的插入 7.判断空 8.堆的删除 9.获取堆的根(顶)元素 10.堆的遍历…

如何看待Unity新的收费模式?

文章目录 背景Unity的论点开发者的担忧如何看待Unity新的收费模式&#xff1f;1. 理解Unity的立场2. 考虑小型开发者3. 探索替代方案4. 对市场变化保持敏感5. 提高游戏质量 结论 &#x1f389; 如何看待Unity新的收费模式&#xff1f; ☆* o(≧▽≦)o *☆嗨~我是IT陈寒&#x1…

Jenkins “Trigger/call builds on other project“用法及携带参数

1.功能 “Trigger/call builds on other project” 功能是 Jenkins 中的一个特性&#xff0c;允许您在某个项目的构建过程中触发或调用另一个项目的构建。 当您在 Jenkins 中启用了 “Trigger/call builds on other project” 功能并配置了相应的触发条件后&#xff0c;当主项…

计算机视觉与深度学习-循环神经网络与注意力机制-Attention(注意力机制)-【北邮鲁鹏】

目录 引出Attention定义Attention-based model通俗解释应用在图像领域图像字幕生成&#xff08;image caption generation&#xff09;视频处理 序列到序列学习&#xff1a;输入和输出都是长度不同的序列 引出Attention 传统的机器翻译是&#xff0c;将“机器学习”四个字都学…

软件工程开发模式:从传统到现代的演进

引言 软件工程开发模式是指导软件开发过程的重要框架&#xff0c;旨在提高软件开发的效率和质量。随着技术的不断进步&#xff0c;软件工程开发模式也在不断发展演变&#xff0c;以适应不同的项目需求和开发环境。本文将介绍传统软件工程开发模式和现代敏捷、精益和DevOps软件…

华为OD机试真题-会议接待-2023年OD统一考试(B卷)

题目描述: 某组织举行会议,来了多个代表团同时到达,接待处只有一辆汽车,可以同时接待多个代表团,为了提高车辆利用率,请帮接待员计算可以坐满车的接待方案,输出方案数量。 约束: 1、一个团只能上一辆车,并且代表团人数(代表团数量小于30,每个代表团人数小于30)小于…

八大排序(二)快速排序

一、快速排序的思想 快速排序是Hoare于1962年提出的一种二叉树结构的交换排序方法&#xff0c;其基本思想为&#xff1a;任取待排序元素序列中的某元素作为基准值&#xff0c;按照该排序码将待排序集合分割成两子序列&#xff0c;左子序列中所有元素均小于基准值&#xff0c;右…

【新版】系统架构设计师 - 案例分析 - 软件工程

个人总结&#xff0c;仅供参考&#xff0c;欢迎加好友一起讨论 文章目录 结构化分析SA数据流图DFD数据流图平衡原则答题技巧例题1例题2 面向对象的分析OOA用例图用例模型细化用例描述用例关系【包含、扩展、泛化】分析模型定义概念类确定类之间的关系类图与对象图实体类 - 存储…

【音视频】MP4封装格式

基本概念 使用MP4box.js查看MP4内部组成结构 整体结构 数据索引&#xff08;moov&#xff09;数据流包&#xff08;mdat&#xff09; 各个包的位置&#xff0c;大小&#xff0c;信息&#xff0c;时间戳&#xff0c;编码方式等全在数据索引 数据流包只有纯二进制码流数据 数据…

C++ - 红黑树 介绍 和 实现

前言 前面 学习了 AVL树&#xff0c;AVL树虽然在 查找方面始终拥有 O(log N &#xff09;的极高效率&#xff0c;但是&#xff0c;AVL 树在插入 ,删除等等 修改的操作当中非常的麻烦&#xff0c;尤其是 删除操作&#xff0c;在实现当中细节非常多&#xff0c;在实现上非常难掌控…

第52节:cesium 3DTiles模型特效+选中高亮(含源码+视频)

结果示例: 完整源码: <template><div class="viewer"><vc-viewer @ready="ready" :logo="false"><vc-navigation

云上亚运:所使用的高新技术,你知道吗?

作者简介&#xff1a;一名云计算网络运维人员、每天分享网络与运维的技术与干货。 公众号&#xff1a;网络豆云计算学堂 座右铭&#xff1a;低头赶路&#xff0c;敬事如仪 个人主页&#xff1a; 网络豆的主页​​​​​ 目录 前言 一.什么是云上亚运会 二.为什么要使用云…

java字符串专项训练(手机号屏蔽)

package 字符串练习;public class 手机号屏蔽 {public static void main(String[] args) {/* 需求: 已经有一个给定的手机号,要把里面第3位到第7位数字改成**///思路: 我想到的有两种方法可解//第一种: 把原字符串先转换成char数组,然后用for循环和if来重新拼接一个字符串//第二…

周赛363(模拟、排序+枚举、二分答案、思维题)

文章目录 周赛363[2859. 计算 K 置位下标对应元素的和](https://leetcode.cn/problems/sum-of-values-at-indices-with-k-set-bits/)模拟 [2860. 让所有学生保持开心的分组方法数](https://leetcode.cn/problems/happy-students/)排序 枚举 [2861. 最大合金数](https://leetco…

【Newman+Jenkins】实施接口自动化测试

一、是什么Newman Newman就是纽曼手机这个经典牌子&#xff0c;哈哈&#xff0c;开玩笑啦。。。别当真&#xff0c;简单地说Newman就是命令行版的Postman&#xff0c;查看官网地址。 Newman可以使用Postman导出的collection文件直接在命令行运行&#xff0c;把Postman界面化运…

负载均衡原理及应用

&#x1f337;&#x1f341; 博主猫头虎&#xff08;&#x1f405;&#x1f43e;&#xff09;带您 Go to New World✨&#x1f341; &#x1f984; 博客首页——&#x1f405;&#x1f43e;猫头虎的博客&#x1f390; &#x1f433; 《面试题大全专栏》 &#x1f995; 文章图文…

AI AIgents时代 - (三.) AutoGPT和AgentGPT

前两篇讲解了Agent的原理和组件&#xff0c;这节我将给大家介绍两个agent项目&#xff0c;给出它们的工作原理和区别&#xff0c;并教大家亲手尝试使用 Agents&#x1f389; &#x1f7e2; AutoGPT&#x1f916;️ 我们的老朋友&#xff0c;之前文章也专门写过。AutoGPT 是一…