Article 5RAEX [SOLVED] Including a user-defined title before printing function arguments

[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
}latest?d=yIl2AUoC8zA latest?i=jZc9yu3JNOE:1NJ6EDTFQWw:F7zBnMy latest?i=jZc9yu3JNOE:1NJ6EDTFQWw:V_sGLiP latest?d=qj6IDK7rITs latest?i=jZc9yu3JNOE:1NJ6EDTFQWw:gIN9vFwjZc9yu3JNOE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments