Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 12-09-2008, 12:14 PM   #1 (permalink)
Pee into the Wind...
 
shady_inc's Avatar
 
Join Date: May 2007
Location: Mumbai
Posts: 782
Default Linux Shell Scripting - bash: ELF command not found


Hello.!
I have a executable tbc stored at $HOME/abc/xyz/tbc.Now, if I try running the executable with ". $HOME/abc/xyz/tbc" or "source $HOME/abc/xyz/tbc", it gives a message:
bash: ELF : command not found
But if I first cd to $HOME/abc/xyz and then run"./tbc", it works just fine.
What's the issue here.?
Thanks.!
__________________
Life is as complicated as you say it is.
shady_inc is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 12-09-2008, 02:47 PM   #2 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: Linux Shell Scripting - bash: ELF command not found

Works fine for me. Can you show us your script?
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 12-09-2008, 08:05 PM   #3 (permalink)
Pee into the Wind...
 
shady_inc's Avatar
 
Join Date: May 2007
Location: Mumbai
Posts: 782
Default Re: Linux Shell Scripting - bash: ELF command not found

The executable I am talking about is the Befunge Compiler.It can be found here.I compiled the C source file and am trying to the executable when it comes up with the error.
__________________
Life is as complicated as you say it is.
shady_inc is offline  
Old 12-09-2008, 08:24 PM   #4 (permalink)
I see right through you.
 
Sykora's Avatar
 
Join Date: Sep 2005
Location: Chennai
Posts: 597
Default Re: Linux Shell Scripting - bash: ELF command not found

When you use source, you're asking the shell to interpret the file. When you try to source a binary executable, it'll try to interpret it and fail. Use source only on scripts which the shell can understand.
__________________
I didn't make the world, I only try to live in it.
http://lucentbeing.com
-- Sykora --
Sykora is offline  
Old 12-09-2008, 09:27 PM   #5 (permalink)
Pee into the Wind...
 
shady_inc's Avatar
 
Join Date: May 2007
Location: Mumbai
Posts: 782
Default Re: Linux Shell Scripting - bash: ELF command not found

Quote:
Originally Posted by Sykora View Post
When you use source, you're asking the shell to interpret the file. When you try to source a binary executable, it'll try to interpret it and fail. Use source only on scripts which the shell can understand.
But that doesn't explain why the executable works when I cd to it's directory and then source it.
__________________
Life is as complicated as you say it is.
shady_inc is offline  
Old 13-09-2008, 01:35 AM   #6 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: Linux Shell Scripting - bash: ELF command not found

Quote:
Originally Posted by shady_inc View Post
". $HOME/abc/xyz/tbc"
This is definitely wrong, no wonder it's giving you a problem. It can be $HOME/abc/xyz/tbc but not this.
Quote:
Originally Posted by shady_inc View Post
"source $HOME/abc/xyz/tbc", it gives a message:
bash: ELF : command not found
Here's the description of source from the man pages
Quote:
source - Evaluate a file or resource as a Tcl script
definitely not what you want.
Quote:
Originally Posted by shady_inc View Post
But if I first cd to $HOME/abc/xyz and then run"./tbc", it works just fine.
What's the issue here.?
Thanks.!
Cos you're running the executable file itself out here.
__________________
http://www.bash.org/?258908
mehulved is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Good Book on Shell Scripting? paragkalra Open Source 2 07-07-2007 08:05 PM
Which book to refer.... learning linux bash scripting.. aditya.shevade Open Source 4 07-03-2007 08:17 AM
goto command for shell scripting? paragkalra Open Source 1 24-07-2006 10:33 AM
Learn the Linux Command Line and Shell Scripting thunderbird.117 Open Source 5 05-07-2006 11:42 AM
HELP shell scripting!! mediator Open Source 3 13-08-2005 12:33 AM

 
Latest Threads
- by clinton
- by soumya
- by Sujeet
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 11:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2