Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ b=1
- $ c=$(echo $b)
- $ echo $c
- 1
- $ b=1
- $ c=$(b=2; echo "$b")
- $ echo "$c"
- 2
- $ b=11; c="$(echo $b)"; echo "$c" ### b exists in subshell.
- 11
- $ $ b=11; c="$(b=33; echo $b)"; echo "$c" ### $b is not replaced before
- 33 ### the subshell is executed.
- $ b=11; bash -c 'echo "<$b>"' ### b does not exist.
- <>
- $ b=11 bash -c 'echo "<$b>"' ### environment b.
- <11>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement