BAEL-3451: Fixed formatting

This commit is contained in:
Sorin Zamfir 2020-01-14 22:27:23 +02:00
parent eb90d115f3
commit 135e9359bd
1 changed files with 12 additions and 14 deletions

View File

@ -51,12 +51,12 @@ function arg_ref_sum_outputs() {
# Subsection 3.1 # Subsection 3.1
variable="baeldung" variable="baeldung"
function variable_scope2(){ function variable_scope2() {
echo "Variable inside function variable_scope2: [$variable]" echo "Variable inside function variable_scope2: [$variable]"
local variable="ipsum" local variable="ipsum"
} }
function variable_scope(){ function variable_scope() {
local variable="lorem" local variable="lorem"
echo "Variable inside function variable_scope: [$variable]" echo "Variable inside function variable_scope: [$variable]"
variable_scope2 variable_scope2
@ -64,18 +64,16 @@ function variable_scope(){
# Subsection 3.2 # Subsection 3.2
subshell_sum=0 subshell_sum=0
function simple_subshell_sum() function simple_subshell_sum() (
( subshell_sum=$(($1+$2))
subshell_sum=$(($1+$2)) echo "Value of sum in function with global variables: [$subshell_sum]"
echo "Value of sum in function with global variables: [$subshell_sum]" )
)
function simple_subshell_ref_sum() function simple_subshell_ref_sum() (
( declare -n sum_ref=$3
declare -n sum_ref=$3 sum_ref=$(($1+$2))
sum_ref=$(($1+$2)) echo "Value of sum in function with ref arguments: [$sum_ref]"
echo "Value of sum in function with ref arguments: [$sum_ref]" )
)
# Subsection 3.3 # Subsection 3.3
function redirection_in() { function redirection_in() {
@ -93,7 +91,7 @@ function redirection_in_ps() {
done done
} < <(ls -ll /) } < <(ls -ll /)
function redirection_out_ps(){ function redirection_out_ps() {
declare -a output=("baeldung" "lorem" "ipsum" "caracg") declare -a output=("baeldung" "lorem" "ipsum" "caracg")
for element in "${output[@]}" for element in "${output[@]}"
do do