2021年2月8日

用Shell判断字符串包含关系

摘要: 方法一:利用grep查找 strA="long string" strB="string" result=$(echo $strA | grep "${strB}") if [[ "$result" != "" ]] then echo "包含" else echo "不包含" fi 先打印长字符串 阅读全文

posted @ 2021-02-08 14:18 uestc2007 阅读(87) 评论(0) 推荐(0) 编辑

shell命令调用http接口(curl方式)

摘要: 样例 1、curl -H "Content-Length:0" -X GET "http://127.0.0.1:8080" 2、curl -H "Content-Type: application/json" -H "connection:Keep-Alive" -s -X POST -d '{" 阅读全文

posted @ 2021-02-08 14:14 uestc2007 阅读(7067) 评论(0) 推荐(0) 编辑

shell脚本实现发送信息到钉钉

摘要: 操作步骤 1、钉钉创建群组 2、编写shell脚本 #!/bin/bash time=$(date "+%Y-%m-%d %H:%M:%S") RESULT1=`curl -H "Content-Type: application/json" -s -X POST -d '[{"optType":" 阅读全文

posted @ 2021-02-08 14:12 uestc2007 阅读(1166) 评论(0) 推荐(1) 编辑

导航