l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2004 Feb 26 13:50

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Binary problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Binary problems

On Thu, 26 Feb 2004, Peter Jay Salzman wrote:

> On Thu 26 Feb 04, 12:28 PM, Doctorcam <cam@ellisonet.ca> said:
> > * Jeff Newmiller (jdnewmil@dcn.davis.ca.us) wrote:
> > 
> > > Sounds to me like you want to provide a directory specification for the
> > > executable...
> > > 
> > >    ./primafax_l.bin
> > > 
> > > or
> > > 
> > >    strace ./primafax_l.bin
> > > 
> > 
> > Colour me red - for embarrassment - I knew this, but the brain wasn't
> > working.  Thank you for pointing out what should have been obvious.
> ok, so now *i'm* confused.
> strace showed a call to open() that returned a file descriptor pointing
> to the binary file.  i believe it was fd 4.
> i thought open() returned -1 upon error?

It does.

Cam tried to invoke the program with

  $ primafax_l.bin

but bash complained that it could not find the file:

  bash: primafax_l.bin: command not found

He then tried to give it as an argument to a separate instance of bash... 

  $ sh primafax_l.bin

which tried to interpret it as a shell script and found that it was not
shell script...

  primafax_l.bin: primafax_l.bin: cannot execute binary file

so then he used strace...

  $ strace sh primafax_l.bin

which simply told him the same thing in more detail.

The behavior of the first token on a bash commandline is different than
its behavior when provided as the argument to an instance of bash... bash
interprets the _argument_ as a normal path to a script file... which
amounts to allowing invocation of shell scripts in the current directory.  
When provided as the first token on a commandline, bash is more cautious
if no slashes are present.

Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.