LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 09-17-2011, 11:17 AM   #1
Coolmax
LQ Newbie
 
Registered: Jul 2009
Location: Poland
Distribution: openSUSE, Debian
Posts: 15

Rep: Reputation: 0
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:
...
 
Old 09-17-2011, 11:35 AM   #2
fatmac
Member
 
Registered: Sep 2011
Location: Surrey/Hants Border, UK
Distribution: AntiX, TinyCore, (& SliTaz)
Posts: 406

Rep: Reputation: Disabled
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.
 
  


Reply

Tags
binary, exec, script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exec format error. Binary file not executable. Fetch Bug? Dimitriy *BSD 2 04-21-2010 05:34 PM
fs, binfmt, exec.c... how/where binary are loaded into ram before execution? kralizec Linux - Kernel 2 03-07-2010 01:31 PM
Exec format error. binary file not executable. kaz2100 Linux - General 2 08-19-2006 06:26 PM
FC5-test1-binary-i386-exec of anaconda failed: no such file or directory, any ideas? frankj Fedora 1 01-02-2006 01:30 AM
c code: how to exec a external program in c feetyouwell Programming 3 04-04-2005 11:44 PM


All times are GMT -5. The time now is 01:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration