Date: Sat, 4 Feb 2017 05:03:34 +0100 From: Polytropon <freebsd@edvax.de> To: "Garance A Drosehn" <drosih@rpi.edu> Cc: "James B. Byrne" <byrnejb@harte-lyne.ca>, freebsd-questions@freebsd.org Subject: Re: Variable assignment in sh Message-ID: <20170204050334.b7c3ea7c.freebsd@edvax.de> In-Reply-To: <6DCAA321-F6E4-4430-8851-8380F589DF13@rpi.edu> References: <mailman.108.1486036867.50898.freebsd-questions@freebsd.org> <7df89058c8e1c2078611909cdb150e4c.squirrel@webmail.harte-lyne.ca> <6DCAA321-F6E4-4430-8851-8380F589DF13@rpi.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 03 Feb 2017 22:48:49 -0500, Garance A Drosehn wrote: > On 3 Feb 2017, at 17:25, James B. Byrne wrote: > > > On Wed, February 1, 2017 19:21, Garance A Drosehn wrote: > > > >> > >> 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 > > > > > > I just wish to clarify something here. What I am doing is attempting > > to reuse a one-liner that has one conditional in it. I do not > > consider that to be scripting or programming. I am just piping > > a few tools together and checking if anything comes out the end. > > Understood, but even those trivial one-liner tasks might be improved > by pasting them into shellcheck. I've had shellcheck point out things > I'm doing which "almost always" work, but will fail depending on the > filenames my one-liner happens to be working on. In this case, the follwing articles might be helpful in the future: David A. Wheeler: Filenames and Pathnames in Shell: How to do it Correctly https://www.dwheeler.com/essays/filenames-in-shell.html And: David A. Wheeler: Fixing Unix/Linux/POSIX Filenames: Control Characters (such as Newline), Leading Dashes, and Other Problems https://www.dwheeler.com/essays/fixing-unix-linux-filenames.html -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170204050334.b7c3ea7c.freebsd>