OSDN Git Service
(root)
/
twpd
/
master.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
6915cf6
)
Regular updates
author
Erik
<erikgronwal@users.osdn.me>
Sat, 6 Jul 2019 14:55:05 +0000
(23:55 +0900)
committer
Erik
<erikgronwal@users.osdn.me>
Sat, 6 Jul 2019 14:55:05 +0000
(23:55 +0900)
bash.md
patch
|
blob
|
history
diff --git
a/bash.md
b/bash.md
index
8f63f0e
..
ab61a3a
100644
(file)
--- a/
bash.md
+++ b/
bash.md
@@
-199,6
+199,19
@@
comment
| `${#FOO}` | Length of `$FOO` |
+### Manipulation
+
+```bash
+STR="HELLO WORLD!"
+echo ${STR,} #=> "hELLO WORLD!" (lowercase 1st letter)
+echo ${STR,,} #=> "hello world!" (all lowercase)
+
+STR="hello world!"
+echo ${STR^} #=> "Hello world!" (uppercase 1st letter)
+echo ${STR^^} #=> "HELLO WORLD!" (all uppercase)
+```
+
+
### Default values
| `${FOO:-val}` | `$FOO`, or `val` if not set |