Skip to content

Commit 1025581

Browse files
committed
Global and local variables
1 parent 79453a5 commit 1025581

File tree

1 file changed

+15
-0
lines changed
  • Shell Scripting Tutorial/Functions/src

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# Declaring a global variable
3+
gvar="I am the global variable!!!"
4+
5+
# Define a function
6+
function1()
7+
{
8+
# Declaring a local variable
9+
lvar="I am the local variable"
10+
echo "$gvar"
11+
echo "$lvar"
12+
}
13+
14+
# Call the function
15+
function1

0 commit comments

Comments
 (0)