-2

I would like to use % as a normal character in printf lets say the output is a is 20% higher than b how would I be able to do that since % is used as a special character?

Tenebris
  • 83
  • 6

2 Answers2

1

Use double %

printf  "hello%%" 
Nicolas
  • 127
  • 1
  • 10
1

You can escape it using %%.

printf "100%%\n"
Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
JoseKilo
  • 2,343
  • 1
  • 16
  • 28