From owner-freebsd-questions@FreeBSD.ORG Fri Dec 1 08:03:21 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A975416A403 for ; Fri, 1 Dec 2006 08:03:21 +0000 (UTC) (envelope-from cptsalek@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7318A43CA5 for ; Fri, 1 Dec 2006 08:03:08 +0000 (GMT) (envelope-from cptsalek@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so2678196wxc for ; Fri, 01 Dec 2006 00:03:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=U7XVhS1gj5Vpe13GxRpyP+m7KIfNiN2Agc5ak5nolR7LbkPqH6wM+OQb62qpZYAeAMlABDD8ICsbMjk/HxcKUTfL2lJKKSDhLBzQ0LlrX9n4+d35jvrfGcLvNuMaVopJRTIIFgxFnrzuHOa+bJJFvvaB4yK/XxRqwn6PSjI7Pnw= Received: by 10.70.54.20 with SMTP id c20mr8097344wxa.1164960200572; Fri, 01 Dec 2006 00:03:20 -0800 (PST) Received: by 10.70.14.20 with HTTP; Fri, 1 Dec 2006 00:03:20 -0800 (PST) Message-ID: <14989d6e0612010003o43774f27p5228c34b02c839ae@mail.gmail.com> Date: Fri, 1 Dec 2006 09:03:20 +0100 From: "Christian Walther" To: "Ray Still" In-Reply-To: <039401c71517$b9ef5750$6700a8c0@New> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <039401c71517$b9ef5750$6700a8c0@New> Cc: freebsd-questions@freebsd.org Subject: Re: problem with script execution 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, 01 Dec 2006 08:03:21 -0000 Try adding "#!/bin/sh" as the first new line of your script. Roughly speaking: This makes the system use /bin/sh as the shell that executes the script. Specifying a PATH inside the script might help, too. Scripts have a very small environment set by default, so your PATH might be just something like /bin:/usr/bin. If sudo is in /usr/local/bin it won't work. Just out of curiosity: What is the "echo * |" supposed to do? From my point of view the shell will expand "*" to the list of files and directories in PWD, so "echo *" acts like a simple ls in this context. This list is piped to sudo. But what does sudo do with these?