Given a list of arguments, I am trying to produce a string looks like the following using bash script:
- arg_1
- arg_2
- arg_3
- arg_4
And here is my script trying to do this:
seeds=
for i in $*; do
seeds=`printf "$seeds - $i\n"`
done;
echo "$seeds"
However, when I run it with input arg_1 arg_2 arg_3 arg_4
, the above script generates the following output, which apparently ignores my spacing and new-line character:
- arg_1 - arg_2 - arg_3 - arg_4
Can I know what did I do wrong in my script? or is there a better way to do this?