Results 1 to 4 of 4

Thread: Why some scripts start with #

  1. #1
    Join Date
    Mar 2009
    Posts
    31

    Why some scripts start with #

    Hi,
    This makes me always confuse. Why some script starts with #. What is the basic explanation behind this. Second thing I have executed a binary compiled file on Linux. Here a error comes up denoting ENOEXEC. The execution command was proper. I was waiting for ENOENT and do have some solution for the same. So what mistake has happened here by me. Any suggestion will be helpful. Thanks.

  2. #2
    Dr. V Guest

    Re: Why some scripts start with #

    The error is related to Exec Format Error. This means when you try to execute a file the system find it as a invalid executable format and the error is returned. The most commonly format under this category is ELF. Also note down a important part that the files executed under the shell will run ASCII files. Every slight change can make the file invalid.

  3. #3
    Join Date
    Apr 2008
    Posts
    3,267

    Re: Why some scripts start with #

    It simply means that the binary compiled executable file has a invalid format. Check that you have given elf format to the same. The shell in your system will claim it as no such file or directory but on the other hand the binary exits. This normally apply to the ELF interpreter. So making some slight changes can resolve your problem.

  4. #4
    Join Date
    Apr 2008
    Posts
    3,522

    Re: Why some scripts start with #

    Here when the Unix kernel runs a program it takes a look on the first 16 bit of the file. This first 16 bits are also called as magic number. This number prohibit kernel from doing some wrong execution. If the kernel fails to get this number then the ENOEXEC error returns on the screen. The file is only executable if this numbers are identified by the kernel. Second thing if you move to different executable file format then you have option where the kernel is told not only to execute but also how to execute. But there is a thin line under this option which can get your the above listed error.

Similar Threads

  1. How to execute scripts in Kaspersky
    By Aspen in forum Networking & Security
    Replies: 2
    Last Post: 20-10-2009, 12:44 PM
  2. Greasemonkey scripts safe?
    By gvBlake in forum Technology & Internet
    Replies: 3
    Last Post: 01-09-2009, 12:04 AM
  3. Scripts are usually safe. Do you want to allow scripts to run ?
    By Ebadaah in forum Technology & Internet
    Replies: 4
    Last Post: 02-07-2009, 12:10 PM
  4. How to Run Shell Scripts ?
    By Denisez in forum Tips & Tweaks
    Replies: 1
    Last Post: 28-03-2009, 12:52 PM
  5. Scripts not running in crontab
    By Frasier in forum Operating Systems
    Replies: 6
    Last Post: 22-10-2008, 01:33 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,016,247.98150 seconds with 17 queries