From owner-freebsd-questions@FreeBSD.ORG Sat Jul 5 19:13:18 2003 Return-Path: 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 6DFC337B401 for ; Sat, 5 Jul 2003 19:13:18 -0700 (PDT) Received: from euclid.cs.niu.edu (euclid.cs.niu.edu [131.156.145.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id C71A744011 for ; Sat, 5 Jul 2003 19:13:17 -0700 (PDT) (envelope-from sendmail+rickert@sendmail.org) Received: from localhost (rickert@localhost [127.0.0.1]) h662DE3q000242; Sat, 5 Jul 2003 21:13:14 -0500 (CDT) To: Kirk Bailey References: <3F07264E.7040404@netzero.net> In-Reply-To: Message from Kirk Bailey of "Sat, 05 Jul 2003 15:26:06 EDT." <3F07264E.7040404@netzero.net> Date: Sat, 05 Jul 2003 21:13:14 -0500 Message-ID: <239.1057457594@euclid.cs.niu.edu> From: Neil W Rickert cc: sendmail-questions@sendmail.org cc: freebsd-questions@freebsd.org Subject: Re: oddity regarding execution X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: sendmail-questions@sendmail.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2003 02:13:18 -0000 Kirk Bailey wrote: >Well, when the alias fed the message to it, it barked. 'unknown mailer error 1' says the >log. Ran it with the sample file, worked fine; even modified the testcase a little, >still fine. Hmmmm... So I added a line to the script, so it would open a file and write >it's current path, and very carefully detailed EXACTLY where this file lived, having a >suspicion. BARK! Although it still barked like a dog, it gave me my confirmation; when >executed by an alias, it thinks the cwd is '/'!!! I modified the script to point EXACTLY >to the location of the recipient file of the data, and all was now well, either way. >HHMMMMMMMMMMMMM..... is this a freebsd quriosity, a sendmail quriosity, or what all? And >is there anything I can do so the cwd will be the dir the script is living in? Actually, this is just the way shell scripts work. If you run your script from another directory, specifying the full path, the shell will not change to the directory containing the script (unless the script does this). -NWR