[SOLVED] Including a user-defined title before printing function arguments
by Faki from LinuxQuestions.org on (#5RAEX)
Have written the following bash function that prints the function arguments. I would like to modify it ts include a user-defined title instead of the current "printf:" string.
Code:print-args ()
{
local i=0
printf "\n%s\n" "printf: \$@:"
for arg in "$@"; do
(( i = i + 1 ))
printf "%s |%s|\n" "${i}." "$arg"
done
}
Code:print-args ()
{
local i=0
printf "\n%s\n" "printf: \$@:"
for arg in "$@"; do
(( i = i + 1 ))
printf "%s |%s|\n" "${i}." "$arg"
done
}