diff options
Diffstat (limited to 'Code/Shell')
-rwxr-xr-x | Code/Shell/func_abc.sh | 23 | ||||
-rwxr-xr-x | Code/Shell/func_slow.sh | 35 | ||||
-rwxr-xr-x | Code/Shell/func_waste.sh | 23 |
3 files changed, 81 insertions, 0 deletions
diff --git a/Code/Shell/func_abc.sh b/Code/Shell/func_abc.sh new file mode 100755 index 0000000..b44ce57 --- /dev/null +++ b/Code/Shell/func_abc.sh @@ -0,0 +1,23 @@ +#!./sh + +func_c() +{ + echo "Function C" + sleep 1 +} + +func_b() +{ + echo "Function B" + sleep 1 + func_c +} + +func_a() +{ + echo "Function A" + sleep 1 + func_b +} + +func_a diff --git a/Code/Shell/func_slow.sh b/Code/Shell/func_slow.sh new file mode 100755 index 0000000..3407646 --- /dev/null +++ b/Code/Shell/func_slow.sh @@ -0,0 +1,35 @@ +#!./sh + +func_c() +{ + echo "Function C" + i=0 + while [ $i -lt 300 ] + do + i=`expr $i + 1` + done +} + +func_b() +{ + echo "Function B" + i=0 + while [ $i -lt 200 ] + do + i=`expr $i + 1` + done + func_c +} + +func_a() +{ + echo "Function A" + i=0 + while [ $i -lt 100 ] + do + i=`expr $i + 1` + done + func_b +} + +func_a diff --git a/Code/Shell/func_waste.sh b/Code/Shell/func_waste.sh new file mode 100755 index 0000000..bfeeecb --- /dev/null +++ b/Code/Shell/func_waste.sh @@ -0,0 +1,23 @@ +#!./sh + +func_c() +{ + /usr/bin/echo "Function C" + sleep 1 +} + +func_b() +{ + /usr/bin/echo "Function B" + sleep 1 + func_c +} + +func_a() +{ + /usr/bin/echo "Function A" + sleep 1 + func_b +} + +func_a |