From owner-freebsd-questions@FreeBSD.ORG Fri Sep 9 21:23:08 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 50DED16A433 for ; Fri, 9 Sep 2005 21:23:08 +0000 (GMT) (envelope-from njt@ayvali.org) Received: from sanddollar.geekisp.com (sanddollar.geekisp.com [204.89.131.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1E4F43D48 for ; Fri, 9 Sep 2005 21:23:07 +0000 (GMT) (envelope-from njt@ayvali.org) Received: (qmail 12428 invoked by uid 1003); 9 Sep 2005 21:23:06 -0000 Received: from clam.int.geekisp.com (HELO clam.geekisp.com) (192.168.4.38) by mail.geekisp.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 9 Sep 2005 21:23:06 -0000 Received: from clam.geekisp.com (njt@localhost.geekisp.com [127.0.0.1]) by clam.geekisp.com (8.13.3/8.12.11) with ESMTP id j89LN6gC005156; Fri, 9 Sep 2005 17:23:06 -0400 (EDT) Received: (from njt@localhost) by clam.geekisp.com (8.13.3/8.13.3/Submit) id j89LN5il017739; Fri, 9 Sep 2005 17:23:05 -0400 (EDT) X-Authentication-Warning: clam.geekisp.com: njt set sender to njt@ayvali.org using -f Date: Fri, 9 Sep 2005 17:23:05 -0400 From: "N.J. Thomas" To: bob self Message-ID: <20050909212305.GC15735@ayvali.org> References: <4321DC05.3050509@charter.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4321DC05.3050509@charter.net> User-Agent: Mutt/1.5.9i Cc: freebsd-questions@freebsd.org Subject: Re: Can't execute a script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2005 21:23:08 -0000 * bob self [2005-09-09 15:01:25 -0400]: > #!/bin/sh > echo "pinging...." > #end of scripttest > > If I run "which scripttest", I get /root/bin/scripttest > > But if I try to run this test script I get "scripttest: Command not found." > > Why is that happening? I've seen something like this happen when there is a non-printing character on the shebang line (like a CTRL-G or similar). So instead of running /bin/sh, your shell tries to run "/bin/sh^G" -- which obviously doesn't exist. Can you run "xxd /root/bin/scripttest" and show us the output? If you don't have xxd on your system (it usually is packaged with Vim) you can try "od -x /root/bin/scripttest". xxd/od will show right away if there is anything funky on the shebang line that shouldn't be there. thanks, Thomas -- N.J. Thomas njt@ayvali.org Etiamsi occiderit me, in ipso sperabo