Subject: Re: more user-friendly error message for /bin/sh?
To: None <>
From: Christos Zoulas <>
List: tech-userlevel
Date: 01/16/2007 20:04:25
In article <>,
Roland Illig  <> wrote:
>Currently, I can do this:
>$ /bin/sh /bin/cat
>/bin/cat: 1: Syntax error: "(" unexpected
>What about the following error message, which says what's really the 
>$ ./sh /bin/cat
>./sh: Cannot execute ELF binary /bin/cat
>(I just hope no one says they really have shell scripts starting with 
>the ELF magic code, and that they need those bytes at the start of the 
>script. ;))

What about other binary files that the kernel can run? a.out for example?

I would say just check if the first few bytes of the file are non ascii,
and say that you cannot execute binary /bin/cat...