LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 10: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, 10:35 AM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,484

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



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 04:34 PM
fs, binfmt, exec.c... how/where binary are loaded into ram before execution? kralizec Linux - Kernel 2 03-07-2010 12:31 PM
Exec format error. binary file not executable. kaz2100 Linux - General 2 08-19-2006 05:26 PM
FC5-test1-binary-i386-exec of anaconda failed: no such file or directory, any ideas? frankj Fedora 1 01-02-2006 12:30 AM
c code: how to exec a external program in c feetyouwell Programming 3 04-04-2005 10:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:32 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
Open Source Consulting | Domain Registration