Skip to content

Commit 4be2163

Browse files
Create Shell_functions.sh
1 parent c79b544 commit 4be2163

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Shell_functions.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
function f1 {
4+
echo Hello from $FUNCNAME!
5+
VAR="123"
6+
}
7+
8+
f2() {
9+
p1=$1
10+
p2=$2
11+
sum=$((${p1} + ${p2}))
12+
echo "${sum}"
13+
}
14+
15+
f1
16+
echo ${VAR}
17+
18+
mySum="$(f2 1 2)"
19+
echo mySum = $mySum
20+
21+
mySum="$(f2 10 -2)"
22+
echo mySum = $mySum

0 commit comments

Comments
 (0)