Skip to content

Commit 35fd3f0

Browse files
Google Shell Style teamdimo414
Google Shell Style team
authored andcommitted
Project import generated by Copybara.
PiperOrigin-RevId: 312117514
1 parent 7a59e42 commit 35fd3f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shellguide.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1253,17 +1253,17 @@ We prefer the use of builtins such as the *Parameter Expansion*
12531253
functions in `bash(1)` as it's more robust and portable
12541254
(especially when compared to things like `sed`).
12551255
1256-
Example:
1256+
Examples:
12571257
12581258
```shell
12591259
# Prefer this:
1260-
addition=$(( ${X} + ${Y} ))
1260+
addition=$(( X + Y ))
12611261
substitution="${string/#foo/bar}"
12621262
```
12631263
12641264
```shell
12651265
# Instead of this:
1266-
addition="$(expr ${X} + ${Y})"
1266+
addition="$(expr "${X}" + "${Y}")"
12671267
substitution="$(echo "${string}" | sed -e 's/^foo/bar/')"
12681268
```
12691269

0 commit comments

Comments
 (0)