on_return

This commit is contained in:
pvincent
2026-07-28 20:10:31 +04:00
parent ff46e651e0
commit 4525f3e558
2 changed files with 87 additions and 35 deletions
+19 -5
View File
@@ -33,11 +33,6 @@ function do_last_false {
! true
}
function do_return {
echo START
return 99
}
function do_command_not_found {
echo START
command_not_found A B C
@@ -50,6 +45,10 @@ function do_exit {
echo SHOULD NOT APPEAR
}
function do_return {
should_return
}
function do_unbound_associative {
declare -A associative
associative['A']='Abc'
@@ -115,6 +114,10 @@ function call_function_which_will_exit {
exit 99
}
function call_function_which_will_return {
return 199
}
function F2 {
echo "stdout A"
# echo toto >>/tmp/toto
@@ -155,6 +158,17 @@ function main {
>&2 echo some trace in stderr2
}
function should_return {
echo A
if call_function_which_will_return; then
echo SUCCESS
else
echo FAILURE
fi
call_function_which_will_return
echo SHOULD NOT APPEAR
}
function F3 {
echo F3
return 0