当前位置:网站首页>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
边栏推荐
猜你喜欢

Why is Prometheus a monitoring artifact sufficient to replace Zabbix?

即时通讯-改变社交与工作状态的新型软件

Using Baidu EasyDL to realize the recognition of the chef's hat of the bright kitchen

Rust 从入门到精通02-安装

展厅全息投影所具备的三大应用特点

什么是驱动程序签名,驱动程序如何获取数字签名?

Raja Koduri澄清Arc GPU跳票传闻 AXG年底前新推四条产品线

Unity Beginner 6 - Simple UI production (blood bar production) and audio addition and NPC dialogue bubbles (2d)

CV-Model【2】:MobileNet v1

Breaking the principle and introducing SQL, what does MongoDB want to do???
随机推荐
Zhou Hongyi: Microsoft copied the 360 security model and became the largest security company in the United States
CV-Model【2】:MobileNet v1
并行化快速排序设想
关于香港高防IP需要关注的几个问题
saltstack学习1入门基础
Unity Beginner 6 - Simple UI production (blood bar production) and audio addition and NPC dialogue bubbles (2d)
亚洲高校首现KDD博士论文奖:清华裘捷中获Runner Up奖,WINNER奖也是位华人
重建丢失的数据
[SCTF2019]Flag Shop
datax enables hana support and dolphinscheduler enables datax tasks
Add the device library after Vivado installation
JS事件参数对象event
奇异值分解(SVD)原理与在降维中的应用(附带例题讲解)(纯理论)
Hand tearing read-write lock performance test
no matching host key type found. Their offer: ssh-rsa
[BJDCTF2020]Cookie is so stable-1|SSTI注入
Parallelized Quick Sort Ideas
dolphinscheduler添加hana支持
EasyNVS云管理平台功能重构:支持新增用户、修改信息等
unity对象池(学习)