I have a stored string "--- RE%d ---\n" in a format variable for printf, but when I use it like:
format="--- RE%d ---\n"
printf $format 1
printf treats -- like I want to use some option. When I put anything before ---, it works fine. Is there a way to make printf to print just: --- RE1 ---? I was using \r as 1st character, but it is shown at script output as ^H.
Add --:
format="--- RE%d ---\n"
printf -- "$format" 1
Use -- to signify the end of the options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With