Maksim Skurydzin
Maksim Skurydzin

Reputation: 10541

Shell complains 'cannot execute binary file'

I've playing around with linux and noticed that for some mysterious reason commands like '/bin/sh ' just will not work. Each time I'm trying to start a process it yields 'cannot execute binary file' error message.

m@sanctuary:~$ sh sed
/bin/sed: /bin/sed: cannot execute binary file

When I first launch sh and try to execute sed, it succeeds.

I'm starting to lose my wits. It would be just great, if somebody could help me.

Thank you.

Upvotes: 1

Views: 9820

Answers (3)

Paul Tomblin
Paul Tomblin

Reputation: 182880

"sed" isn't a shell script, so you don't execute it with sh. Just type sed ...args... not sh sed ...args...

Upvotes: 6

nos
nos

Reputation: 229342

You're trying to run sed as a shell script, sed is just an ordinary executable. You can just run it as

m@sanctuary:~$ sed

Upvotes: 2

Brian Agnew
Brian Agnew

Reputation: 272417

sh is expecting a shell script as an argument, but you're giving it a binary file.

Upvotes: 0

Related Questions