开发者

bash command arguments

开发者 https://www.devze.com 2023-02-16 06:40 出处:网络
I have a bash script that, for reasons I won\'t discuss, cannot be made executable. However, I need to pass arguments to that script.

I have a bash script that, for reasons I won't discuss, cannot be made executable. However, I need to pass arguments to that script.

I have开发者_如何学Go tried this:

bash MyBashScript.sh MyArgumentOne

But the argument MyArgumentOne isn't passed to the script. I know there must be a way to do this, can anyone help?


Your given command should work. Try to debug with calling trough

strace -o all_system_calls.txt -f -ff bash MyBashScript.sh MyArgumentOne

one of the all_system_calls.txt.<pid> files created should contain something like

execve("/bin/bash", ["bash", "MyBashScript.sh", "MyArgumentOne"], [/* 71 vars */]) = 0

If so you know for sure that the argument is passed into your script.

0

精彩评论

暂无评论...
验证码 换一张
取 消