Ex001 - Anylang
./scripts/func/utils/general/output/repeat.f
# ----------------------------------------------
# Scripting Unix Architecture - Brqx 2023
# Version Curso 0.0.3
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# O - repeat - Chapter 001 - Num 030
# ==============================================
# To be sure every echo is important
repeat()
{
VER="0.0.0.2"
repeat_u="r | repeat STRING [NUM]"
##"${1}" == "-?" -o
if [ "${1}" == "-?" -o "${1}" == "" ] ; then
OO "==--==--==--==--==--==--==--==--==--==--==--==--==--==--=="
OO "${repeat_i} [${VER}]"
OO "=========================================================="
formateo3 "${repeat_i}" "${repeat_u}" "${VER}"
OO "==--==--==--==--==--==--==--==--==--==--==--==--==--==--=="
else
CHAR=$1
NUM=$2
if [ "${NUM}" == "" ] ; then
# By default we repeat 10 times
NUM=10
fi
test="";num=${NUM};
for ((i=0 ; i<$num; i++)); do
test+="${CHAR}"
done
echo $test
fi
}
# ----------------------------------------------
# Hooks - Set num of repeats
#_alias --> hooks for functions
_r_num()
{
if [ "${1}" != "-?" -o "${1}" != "" ] ; then
NUM=$1
fi
}
alias r
# ----------------------------------------------
# Scripting Unix Architecture - Brqx 2023
# Course Version 0.0.3
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Alias r
# ----------------------------------------------
# Scripting Unix Architecture - Brqx 2023
# Version Curso 0.0.3
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# O - repeat - Chapter 001 - Num 030
# ==============================================
# Alias r - Repeat
alias r='repeat'
alias R='r'
r_i="$( __t 'arq_OO' )"
repeat_i="${DD_i}"
alias r
# ----------------------------------------------
# Scripting Unix Architecture - Brqx 2023
# Course Version 0.0.3
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Alias r - Repeat
alias r='repeat'
alias R='r'
r_i="$( __t 'arq_OO' )"
repeat_i="${DD_i}"