fix prompt IFS

This commit is contained in:
pvincent
2026-07-16 18:09:19 +04:00
parent fc5d68e58f
commit 08b943500e
5 changed files with 165 additions and 23 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env miaou-bash
#!/usr/bin/env bash
function blabla {
echo IN blabla OUT
>&2 echo stderr from utility
# . lib/not_found_again.bash
# lib/not_found_again.bash
suite
}
function suite {
command_not_found
echo $nope
exit 10 # youpi
return 7
return
exit
}
blabla
+102
View File
@@ -0,0 +1,102 @@
#!/usr/bin/env miaou-bash
# CONSTANTS
BASEDIR=$(dirname "$0")
readonly BASEDIR
# FUNCTIONS
function F2 {
echo "stdout A"
# echo toto >>/tmp/toto
return
>&2 echo "This is stderr"
blabla
$nope
exit 6
grep titi toto
echo "stdout B"
echo "stdout C"
# command_not_found
}
function F1 {
echo F1
F2
}
function main {
F1
F3
echo before subshell
echo "here in subshell $(grep titi $0)"
echo NO MORE
result=$(grep titi $0)
[[ "$result" -ne 0 ]] && echo true
# grep titi nope
>&2 echo some trace in stderr1
"$BASEDIR/extra/library.bash"
. "$BASEDIR/lib/utility.bash"
# . not_found/not_found.bash
# echo "here in subshell $(grep titi nope)"
# ls -l nope
>&2 echo some trace in stderr2
}
function F3 {
echo F3
return 0
}
function usage {
echo "USAGE: $0 <success|unbound-variable>"
echo -e "\trun case scenario which performs various bash statements and mostly fails"
echo -e "\tthese case scenarii helps testing the miaou-bash script"
}
function do_success {
echo SUCCESS
}
function do_unbound_variable {
a=5
echo "a=${a}"
echo "b=${b}"
}
function introspect_scenarii {
mapfile -t SCENARII <<<"$(compgen -A function | grep ^do_)"
}
# MAIN
[[ $# -eq 0 ]] && >&2 echo 'arg1 expected!' && usage && exit 1
scenario="$1"
shift
mapfile -t scenarii <<<"$(compgen -A function | grep ^do_)"
args=("$@")
echo "scenarii = ${scenarii[@]}"
exit 0
echt "start of useless $0 $* ($# args)"
if grep titi nope 2>/dev/null; then
echo OK
else
echo not found but ok
fi
if grep titi "$BASEDIR/lib/utility.bash"; then
echo OK
else
echo not found but ok
fi
echo question?:
# read -r answer
# echo "$answer"
echo suite
main
echo end of useless