From e647074cd0fabadd10bc8e90a49bde57c31370a4 Mon Sep 17 00:00:00 2001 From: Marc Date: Sun, 25 Oct 2020 22:50:11 -0700 Subject: [PATCH] Clarify that there are two examples unrelated to each other (spent way too much time trying to relate them) --- SC2155.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SC2155.md b/SC2155.md index 537ca05..4b7d1f6 100644 --- a/SC2155.md +++ b/SC2155.md @@ -68,13 +68,14 @@ readonly foo ## Word splitting and quoting issue with dash, maybe others -A serious quoting problem with dash is another reason to declare and assign separately. Dash is the [default, `/bin/sh` shell on Ubuntu](https://wiki.ubuntu.com/DashAsBinSh). More specifically, dash version 0.5.8-2.10 and others cannot run this code: +A serious quoting problem with dash is another reason to declare and assign separately. Dash is the [default, `/bin/sh` shell on Ubuntu](https://wiki.ubuntu.com/DashAsBinSh). More specifically, dash version 0.5.8-2.10 and others cannot run these two examples: ```sh f(){ local e=$1; } f "1 2" + export g=$(printf '%s' "foo 2") ``` -While this runs fine in other shells, [dash doesn't treat this as an assignment](http://mywiki.wooledge.org/BashPitfalls#local_var.3D.24.28cmd.29) and fails like this: +While this runs fine in other shells, [dash doesn't treat any of these as assignments](http://mywiki.wooledge.org/BashPitfalls#local_var.3D.24.28cmd.29) and fails both like this: ``` local: 2: bad variable name export: 2: bad variable name