簡體   English   中英

在執行執行腳本的管道中,如何將參數傳遞給bash

[英]How can I pass parameter into bash while scripts it executes are piped in

我的意思是當我使用這種formart執行bash腳本時:

bash < <( curl http://rvm.io/releases/rvm-install-head )

要么

curl http://rvm.io/releases/rvm-install-head | bash

如何在執行過程中傳遞額外的參數?

謝謝

-s切換后添加參數。

使用示例:

echo 'echo params count: ${#@}, params: $@' | bash -s param1 param2

輸出:

params count: 2, params: param1 param2

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM