From owner-freebsd-questions@freebsd.org Thu Feb 2 00:29:21 2017 Return-Path: Delivered-To: freebsd-questions@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 C00A1CCCC7F for ; Thu, 2 Feb 2017 00:29:21 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp9.server.rpi.edu (smtp9.server.rpi.edu [128.113.2.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "canit.localdomain", Issuer "canit.localdomain" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 86ACF1C61 for ; Thu, 2 Feb 2017 00:29:21 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp-auth3.server.rpi.edu (route.canit.rpi.edu [128.113.2.233]) by smtp9.server.rpi.edu (8.14.4/8.14.4/Debian-8+deb8u1) with ESMTP id v120Ln3c016571 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 1 Feb 2017 19:21:49 -0500 Received: from smtp-auth3.server.rpi.edu (localhost [127.0.0.1]) by smtp-auth3.server.rpi.edu (Postfix) with ESMTP id 1DF9558077; Wed, 1 Feb 2017 19:21:49 -0500 (EST) Received: from [128.113.24.47] (gilead-qc124.netel.rpi.edu [128.113.124.17]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: drosih) by smtp-auth3.server.rpi.edu (Postfix) with ESMTPSA id A573F5806B; Wed, 1 Feb 2017 19:21:48 -0500 (EST) From: "Garance A Drosehn" To: byrnejb@harte-lyne.ca Cc: Polytropon , freebsd-questions@freebsd.org Subject: Re: Variable assignment in sh Date: Wed, 01 Feb 2017 19:21:48 -0500 Message-ID: In-Reply-To: <84861d4906923faec222f96580833c2f.squirrel@webmail.harte-lyne.ca> References: <20170131161824.a9f1ef46.freebsd@edvax.de> <20170131185103.7f911dfb.freebsd@edvax.de> <5f51e2c3bdb8a20c6a7786c2b345c957.squirrel@webmail.harte-lyne.ca> <20170131200143.00c5e5da.freebsd@edvax.de> <84861d4906923faec222f96580833c2f.squirrel@webmail.harte-lyne.ca> MIME-Version: 1.0 X-Mailer: MailMate (1.9.6r5319) X-Virus-Scanned: ClamAV using ClamSMTP X-Bayes-Prob: 0.0001 (Score 0, tokens from: outgoing, @@RPTN) X-Spam-Score: 0.00 () [Hold at 10.10] X-CanIt-Incident-Id: 02SDAlNAx X-CanIt-Geo: ip=128.113.124.17; country=US; region=New York; city=Troy; latitude=42.7495; longitude=-73.5951; http://maps.google.com/maps?q=42.7495,-73.5951&z=6 X-CanItPRO-Stream: outgoing X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.229 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 00:29:21 -0000 On 1 Feb 2017, at 14:59, James B. Byrne via freebsd-questions wrote: > On Tue, January 31, 2017 14:01, Polytropon wrote: >> >> I know, those are very special cases, and if your goal is not >> portability and "guaranteed availability", then it won't hit you. >> I just thought it's worth being mentioned. > > Thank you. I have found your explanation of what goes on under the > covers very interesting. In this case I am dealing with a zfs system > so if /usr is not there then neither is /bin. On something of minor tangent, if you're writing scripts in either 'sh' or 'bash', you may find the following web site helpful: http://www.shellcheck.net shellcheck is also available as a port, if you don't want to be pasting your shell code into somebody else's web site. The last time I checked, the port brings in several other ports, so I tend to use the web site. -- Garance Alistair Drosehn = drosih@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA