当前位置:网站首页>curl 执行脚本时传递环境变量与参数
curl 执行脚本时传递环境变量与参数
2022-07-30 12:37:00 【十二翼堕落天使】
脚本文件
vim temp.sh
echo "A = ${A}"
echo "\$0 = $0"
echo "P1 = $1"
echo "P2 = $2"
echo "P3 = $3"
nohup python3 -m http.server &> /dev/null &
管道
-f ,--fail | 表示在服务器错误时,阻止一个返回的表示错误原因的 html 页面,而由 curl 命令返回一个错误码 22 来提示错误 |
-s ,--slient | -s 参数将不输出错误和进度信息 |
-S ,--show-error | -S 参数指定只输出错误信息,通常与 -s 一起使用。 |
-L ,--location | -L 参数会让 HTTP 请求跟随服务器的重定向。curl 默认不跟随重定向 |
[[email protected]:~]# curl -fsSL http://localhost:8000/temp.sh | A=1 bash -s -- -p1 --p2 p3
A = 1
$0 = bash
P1 = -p1
P2 = --p2
P3 = p3
进程替换
[[email protected]:~]# A=1 bash <(curl -fsSL http://localhost:8000/temp.sh) -p1 --p2 p3
A = 1
$0 = /dev/fd/61
P1 = -p1
P2 = --p2
P3 = p3
边栏推荐
- CMake库搜索函数居然不搜索LD_LIBRARY_PATH
- Why is Prometheus a monitoring artifact sufficient to replace Zabbix?
- C#实现软键盘的制作
- 崩了,该来的终究躲不掉
- 腰部外骨骼机器人线性自抗扰控制器参数优化
- Dry Goods Sharing: Various Implementation Methods of Bean Management Factory with Great Use of Small Skills
- unity初学6——简易的UI制作(血条制作)和音频加入以及NPC的对话气泡(2d)
- 什么是驱动程序签名,驱动程序如何获取数字签名?
- [ASP.NET Core] Dependency Injection for Option Classes
- Yilian: Activating the Value Potential of Data Elements and Unleashing the Innovation Dividend of SAS SSD
猜你喜欢
常见的云计算安全问题以及如何解决
Unity Beginner 6 - Simple UI production (blood bar production) and audio addition and NPC dialogue bubbles (2d)
北上广线下活动丨年底最不可错过的技术聚会都齐了
Apifox generates interface documentation tutorial and operation steps
【Kaggle:UW-Madison GI Tract Image Segmentation】肠胃分割比赛:赛后复盘+数据再理解
nodeJs--fs模块
为什么说Prometheus是足以取代Zabbix的监控神器?
忆联:激活数据要素价值潜能,释放SAS SSD创新红利
私有化部署的即时通讯平台,为企业移动业务安全保驾护航
看了这些6G原型样机,我想一觉睡到2030年
随机推荐
Execution order of select, from, join, on where groupby, etc. in MySQL
Based on MySQL database, Redis cache, MQ message middleware, ES high availability scheme of search engine parsing
js 构造函数 return 非空对象,其实例化的对象在原型上的差异
湖仓一体电商项目(二):项目使用技术及版本和基础环境准备
Anaconda\Scripts\pip-script.py is not present ? 解决方案
【ASP.NET Core】选项类的依赖注入
Mysql索引结构
MySQL查询性能优化
维护数千规模MySQL实例,数据库灾备体系构建指南
Unity Beginner 6 - Simple UI production (blood bar production) and audio addition and NPC dialogue bubbles (2d)
13-GuliMall Basics Summary
常见的云计算安全问题以及如何解决
湖仓一体电商项目(一):项目背景和架构介绍
重建丢失的数据
IO/multiplexing (select/poll/epoll)
力扣——15. 三数之和
[SCTF2019]Flag Shop
腰部外骨骼机器人线性自抗扰控制器参数优化
Raja Koduri澄清Arc GPU跳票传闻 AXG年底前新推四条产品线
There is no one of the strongest kings in the surveillance world!