From owner-freebsd-questions  Tue Apr 17 16:12:54 2001
Delivered-To: freebsd-questions@freebsd.org
Received: from smtp-1.enteract.com (mail.enteract.com [207.229.143.33])
	by hub.freebsd.org (Postfix) with ESMTP id D96D437B43C
	for <freebsd-questions@freebsd.org>; Tue, 17 Apr 2001 16:12:52 -0700 (PDT)
	(envelope-from dscheidt@tumbolia.com)
Received: from shell-2.enteract.com (shell-2.enteract.com [207.229.143.41])
	by smtp-1.enteract.com (Postfix) with ESMTP
	id 0B21F66CB; Tue, 17 Apr 2001 18:12:52 -0500 (CDT)
Date: Tue, 17 Apr 2001 18:12:51 -0500 (CDT)
From: David Scheidt <dscheidt@tumbolia.com>
X-Sender: dscheidt@shell-2.enteract.com
To: Zhihui Zhang <zzhang@cs.binghamton.edu>
Cc: freebsd-questions@freebsd.org
Subject: Re: command script file
In-Reply-To: <Pine.SOL.4.21.0104171851150.21471-100000@onyx>
Message-ID: <Pine.BSF.4.21.0104171806340.20719-100000@shell-2.enteract.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-freebsd-questions@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.ORG

On Tue, 17 Apr 2001, Zhihui Zhang wrote:

:
:If I have the following file named doit:
:
:# cat doit
:pwd 
:ls -al
:# chmod u+x doit.
:# ./doit
:
:It runs OK even if there is no #!/bin/sh at its first line. Is this
:feature implemented in the shell or kernel? If in shell, how does it
:implement it?   Thanks.
:

The shell attempts to exec the file.  If that fails, it's passed to the
shell with the name of the file as the first arguement.  See exec(3) to see
how you can do it.


-- 
dscheidt@tumbolia.com
Bipedalism is only a fad.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message