当前位置:网站首页>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
边栏推荐
- 【Kaggle:UW-Madison GI Tract Image Segmentation】肠胃分割比赛:赛后复盘+数据再理解
- 13-GuliMall Basics Summary
- for循环的3个表达式执行顺序
- RTSP/Onvif协议视频平台EasyNVR服务一键升级功能的使用教程
- 和数集团:让智慧城市更智慧,让现实生活更美好
- 【23考研】408代码题参考模板——顺序表
- There is no one of the strongest kings in the surveillance world!
- Another blast!Ali's popular MySQL advanced collection is open source, reaching P7
- 【河北工业大学】考研初试复试资料分享
- 数字化时代,寻求企业财务转型路径的最优解
猜你喜欢
力扣——11.盛最多水的容器
云主机上的MongoDB被威胁,开启AUTH认证
OpenHarmony环境搭建报错: ImportError: cannot import name ‘VERSION‘ from ‘hb.__main__‘
关于香港高防IP需要关注的几个问题
【记一个kaggle划水比赛】PetFinder.my - Pawpularity Contest 宠物预测
【Kaggle比赛常用trick】K折交叉验证、TTA
13-GuliMall Basics Summary
和数集团:让智慧城市更智慧,让现实生活更美好
[BJDCTF2020]Cookie is so stable-1|SSTI injection
Win11打不开exe应用程序怎么办?Win11无法打开exe程序解决方法
随机推荐
爱可可AI前沿推介(7.30)
MySQL【排序与分页】
leetcode207.课程表(判断有向图是否有环)
C#实现软键盘的制作
[PostgreSQL] - 存储结构及缓存shared_buffers
Using Baidu EasyDL to realize the recognition of the chef's hat of the bright kitchen
Yilian: Activating the Value Potential of Data Elements and Unleashing the Innovation Dividend of SAS SSD
在 Scala 中读取整个文件
【Kaggle比赛常用trick】K折交叉验证、TTA
电流电压采集模块DAM-6160
Scala基础:数组(Array)、映射(Map)、元组(Tuple)、集合(List)
Parallelized Quick Sort Ideas
saltstack学习2grains&pillar
【23考研】408代码题参考模板——链表
【河北工业大学】考研初试复试资料分享
力扣——11.盛最多水的容器
基于卷积神经网络与双向长短时融合的锂离子电池剩余使用寿命预测
no matching host key type found. Their offer: ssh-rsa
亚洲高校首现KDD博士论文奖:清华裘捷中获Runner Up奖,WINNER奖也是位华人
DOM常用方法以及项目