Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. $ b=1
  2. $ c=$(echo $b)
  3. $ echo $c
  4. 1
  5.  
  6. $ b=1
  7. $ c=$(b=2; echo "$b")
  8. $ echo "$c"
  9. 2
  10.  
  11. $ b=11; c="$(echo $b)"; echo "$c" ### b exists in subshell.
  12. 11
  13. $ $ b=11; c="$(b=33; echo $b)"; echo "$c" ### $b is not replaced before
  14. 33 ### the subshell is executed.
  15.  
  16. $ b=11; bash -c 'echo "<$b>"' ### b does not exist.
  17. <>
  18. $ b=11 bash -c 'echo "<$b>"' ### environment b.
  19. <11>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement