Karellism

script1.sh

Dec 17th, 2020
932
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.24 KB | None | 0 0
  1. #!/bin/bash
  2. # demonstrate variable scope 1.
  3.  
  4. var1=blah
  5. var2=foo
  6.  
  7. # Let's verify their current value
  8.  
  9. echo $0 :: var1 : $var1, var2 : $var2
  10.  
  11. export var1
  12. ./script2.sh
  13.  
  14. # Let's see what they are now
  15.  
  16. echo $0 :: var1 : $var1, var2 : $var2
Advertisement
Add Comment
Please, Sign In to add comment