I know that if I do print (\"f\" + 2 * \"o\") in python the output will be foo.
print (\"f\" + 2 * \"o\")
foo
But how do I do the same thing in a bash script?
That will do:
printf 'f'; printf 'o%.0s' {1..2}; echo
Look here for explanations on the "multiplying" part.