From owner-freebsd-current@freebsd.org Fri Apr 14 18:58:58 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 A824FD3E3F1 for ; Fri, 14 Apr 2017 18:58:58 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from mail-in24.apple.com (mail-out24.apple.com [17.171.2.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DDCFC93 for ; Fri, 14 Apr 2017 18:58:57 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from relay4.apple.com (relay4.apple.com [17.128.113.87]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in24.apple.com (Apple Secure Mail Relay) with SMTP id 42.06.22073.56811F85; Fri, 14 Apr 2017 11:43:49 -0700 (PDT) X-AuditID: 11ab0218-e3b909a000005639-38-58f11865a482 Received: from [17.150.219.72] (Unknown_Domain [17.150.219.72]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by relay4.apple.com (Apple SCV relay) with SMTP id 32.8F.13512.46811F85; Fri, 14 Apr 2017 11:43:48 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: csh script help From: Chuck Swiger In-Reply-To: <58F115A8.8010407@gmail.com> Date: Fri, 14 Apr 2017 11:43:47 -0700 Cc: FreeBSD current Content-Transfer-Encoding: quoted-printable Message-Id: <427BD3AE-6619-4E3A-BFE7-32882B46921D@mac.com> References: <58F0D301.7000509@gmail.com> <9A420780-8DEB-4FBA-9CDE-A9E152110E38@mac.com> <58F115A8.8010407@gmail.com> To: Ernie Luzar X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: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al6 yfm5mxhBYdVQGL6D8d8yq0OMAhyMSjy8FUc/RAixJpYVV+YeYpTgYFYS4U0S/BghxJuSWFmV WpQfX1Sak1p8iFGag0VJnLd/N1C1QHpiSWp2ampBahFMlomDU6qBcftsxfPzn2tkP7dmUvlu YxAiL8s+q3vJYQcNubYKwymGfFf4M2uWqXqxZqS/nul8b/q2bgM91TKvR9NTVz/coCXStuvJ wlU619f2+z54cv6cw/SzdnKptWtYZ///815WrPvanAc2O33sy5U2nxEri/k0YxFPi1m6T3Hq Hc6zd+7KesQ06t98o8RSnJFoqMVcVJwIAGqMgHMnAgAA 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 18:58:58 -0000 Hi-- On Apr 14, 2017, at 11:32 AM, Ernie Luzar wrote: > Chuck Swiger wrote: >> On Apr 14, 2017, at 6:47 AM, Ernie Luzar wrote: >>> 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. >>=20 >> Since you've gotten an answer to the question you asked, let me only = note that both sh and csh support the -x flag, which causes the shell to = echo the commands as it runs. This is extremely helpful for debugging. >> Regards, >=20 > Where is the this -x flag coded at? Do the executed lines roll fast = off the screen or can I slowly step through the script a line at a time? >=20 > Thanks for this bit of information. You can either run the script via "/bin/sh -x myscript.sh" and similar = for csh, or you can add -x to the first line of the script, commonly "#! = /bin/sh" and invoke it directly via ./myscript.sh. The lines are displayed as rapidly as the shell runs. If running natively on FreeBSD, most people would use a terminal = emulator like xterm which provides scrollback. You could also run under = nohup, which will save output to a file named nohup.out, unless you = redirect output somewhere else. Regards, --=20 -Chuck