notes/Global and Local Variables-0r1Bg5sq.sh
#!/bin/bash


x=20
myfun(){
  echo "Global x is $x"
  local x=10;
  echo "local x is $x"
}

echo "x out side of funtion is $x - Global x"
myfun
echo "x out side of funtion is $x - Global x"

syntax highlighted by Code2HTML, v. 0.9.1