开发者

Shell complains 'cannot execute binary file'

开发者 https://www.devze.com 2022-12-25 02:31 出处:网络
I\'ve playing around with linux and noticed that for some开发者_如何学Python mysterious reason commands like \'/bin/sh \' just will not work. Each time I\'m trying to start a process it yields \'canno

I've playing around with linux and noticed that for some开发者_如何学Python 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.


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


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号