LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Exec binary code from script (https://www.linuxquestions.org/questions/linux-newbie-8/exec-binary-code-from-script-903541/)

Coolmax 09-17-2011 10:17 AM

Exec binary code from script
 
Hi all,
Is there anyway to run ELF executable binary from script? For exec I have to pass binary filename as argument.
Code:

#!/bin/bash
sth_for_exec_binary `tail -n +5 $0`

PAYLOAD:
...


fatmac 09-17-2011 10:35 AM

exec binary from script
 
I believe you may want to use a sub shell to run your binary.
If it's run from a top level shell, I'm of the understanding, that you pass control over to the binary from the script, therefore ending your script.
If you are needing information from the binary, I think you will need to redirect it to a file, & then open that file in your top level script.


All times are GMT -5. The time now is 02:47 PM.