tags:

views:

201

answers:

2

Hi 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

+1  A: 

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.

mouviciel
i want embedded bash because when i use System(" any unix command "); its run perfectly on simulator not on Device.If u have any other idea to run System ("unix command"); on device plz guide me
This means we cannot execute unix command on iphone Device
A: 

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.

unwind
Telling him to look into fork() and exec() is useless, because you won't be able to use those functions on the iPhone.
Nathan de Vries