just_for_fun/episode_7/code/task.sh
2024-12-18 12:29:27 +03:00

60 lines
783 B
Bash
Executable File

#!/bin/bash
#set -x
#echo "Hello, World!"
files=(*)
for file in "${files[@]}"; do
echo "$file"
done
#var1='A'
#var2='B'
my_function () {
echo "First argument is $1"
echo "Second argument is $2"
local var1='C'
var2='D'
echo "Inside function: var1: $var1, var2: $var2"
echo 'aaaaa'
g_result_git=( 2 3 4 5 )
}
befor_call(){
echo "befor_call"
}
after_call(){
echo "after_call"
}
decarator(){
befor_call
echo `$1`
res=`$1`
after_call
}
closure(){
local count=1
increment() {
count=$((count + 1))
}
echo 'increment'
}
res=$(closure)
echo `$res`
#decarator 'my_function'
#echo ${g_result_git[@]}
#echo "Before executing function: var1: $var1, var2: $var2"
#echo "After executing function: var1: $var1, var2: $var2"
#fn="my_function"