Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Sep 2005 20:42:30 -0400
From:      "N.J. Thomas" <njt@ayvali.org>
To:        bob self <bobself@charter.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Can't execute a script
Message-ID:  <20050910004230.GD15735@ayvali.org>
In-Reply-To: <43220F9F.9050002@charter.net>
References:  <4321DC05.3050509@charter.net> <20050909212305.GC15735@ayvali.org> <43220F9F.9050002@charter.net>

next in thread | previous in thread | raw e-mail | index | archive | help
* bob self <bobself@charter.net> [2005-09-09 18:41:35 -0400]:
> 0000000: 2321 2f62 696e 2f73 680d 0a65 6368 6f20  #!/bin/sh..echo
                                 ^^   
> 0000010: 2270 696e 6769 6e67 2e2e 2e2e 220d 0a    "pinging...."..

Yup, that's your problem. This file is a DOS text file, so its end of
line is a <cr><nl> (0x0d 0x0a) instead  of just <nl> (0x0a).

Normally, that doesn't matter because most Unix utilities are
multi-eol-format aware, but you can't have it in the shebang line
because the OS interprets the extra carriage as part of the command, so
it is looking for /bin/sh^M, which doesn't exist.

Use a utility like dos2unix or some a decent text editor to convert this
to a Unix file format and you'll be good to go.

Thomas

-- 
N.J. Thomas
njt@ayvali.org
Etiamsi occiderit me, in ipso sperabo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050910004230.GD15735>