compile the entire bash shell into my app

2020-08-01 06:38发布

I want to know how i compile the entire bash shell into my app.I read somewhere that for this i compile its Subroutine. how?

Thanks in advance

2条回答
在下西门庆
2楼-- · 2020-08-01 07:15

A comment to mouviciel's answer implies you believe you can gain the ability to execute arbitrary Unix commands, by embedding bash. This is not correct.

Bash is a shell, i.e. an interactive environment allowing a user to enter commands, and have them run. It adds lots of functionality, programmability, and tons of features, but at its core it's still basically just reading input, and then executing commands.

查看更多
欢心
3楼-- · 2020-08-01 07:16

Why do you need an embedded bash?

Without more details, I would say that Lua is a more appropriate approach for scripting in an application.

EDIT:

Assuming from your other questions that your target device is an iPhone, you may be interested in reading this question: iPhone - is it possible to make system call. In short, you cannot use system() on iPhone.

After digging the subject with Google, I found that not only system() is unavailable but also exec() and NSTask class. I suspect that popen() is unavailable as well.

查看更多
登录 后发表回答