From owner-freebsd-current@freebsd.org Fri Apr 14 14:08:43 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41085D3D5A1 for ; Fri, 14 Apr 2017 14:08:43 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0689BB96 for ; Fri, 14 Apr 2017 14:08:42 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd38.aul.t-online.de (fwd38.aul.t-online.de [172.20.26.138]) by mailout04.t-online.de (Postfix) with SMTP id E1C4641BFB04; Fri, 14 Apr 2017 16:08:33 +0200 (CEST) Received: from Stefans-MBP.fritz.box (bppzj+ZXghb-Xn89e3Ffj7LuQHBev4StXdpYB8C4WOpi4vmMThP97h6F0D2F0FPZA-@[84.154.103.108]) by fwd38.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1cz1tp-1YY5fE0; Fri, 14 Apr 2017 16:08:33 +0200 Subject: Re: csh script help To: freebsd-current@freebsd.org References: <58F0D301.7000509@gmail.com> From: Stefan Esser Cc: luzar722@gmail.com Message-ID: <2b66121b-2bec-81fd-4281-7cf02dae7434@freebsd.org> Date: Fri, 14 Apr 2017 16:08:32 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <58F0D301.7000509@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-ID: bppzj+ZXghb-Xn89e3Ffj7LuQHBev4StXdpYB8C4WOpi4vmMThP97h6F0D2F0FPZA- X-TOI-MSGID: ac4447a3-1cc2-4582-a815-ef024c0c0977 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 14:08:43 -0000 Am 14.04.17 um 15:47 schrieb Ernie Luzar: > To aid in debugging the script I'm writing, I place "echo" commands > throughout so I can kind of have a trace of the logic as different > conditions are processed. Normally I just delete these "echo" commands > after I get the script working. > > But this time I want to try something different. I want to > enable/disable the echo commands in mass. So in the beginning of the > script I added these 2 lints. > > #trace="" # use to enable trace echo > trace="#" # use to disable trace echo > > In front of each of the echo commands I added this, > $trace echo "what ever." > > When I exec the script I get error message #: not found This is to be expected ;-) > What is happing here? Is the substitution to late? No. > Is there a way to fix this? Use ":" instead of "#" to insert a "null command" before the echo: % set trace="" % $trace echo Hello Hello % set trace=":" % $trace echo Hello % Regards, STefan