DIGIT-ARC read-only archive · snapshot: July 23, 2026

Linux Shell Scripting - bash: ELF command not found

6 posts · originally from https://geek.digit.in/community/threads/linux-shell-scripting-bash-elf-command-not-found.97635/

shady_inc
shady_inc Original post #1
Sep 12, 2008 at 12:14 PM
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.!
M
Sep 12, 2008 at 2:47 PM
Works fine for me. Can you show us your script?
shady_inc
Sep 12, 2008 at 8:05 PM
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.
Sykora
Sykora #4
Sep 12, 2008 at 8:24 PM
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.
shady_inc
Sep 12, 2008 at 9:27 PM
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.
M
Sep 13, 2008 at 1:35 AM
". $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.
"source $HOME/abc/xyz/tbc", it gives a message:
bash: ELF : command not found
Here's the description of source from the man pages
source - Evaluate a file or resource as a Tcl script
definitely not what you want.
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.