Skip to main content
2 of 4
edited body
NlightNFotis
  • 7.7k
  • 7
  • 34
  • 38

You might want to use printf for its formatting options. echo is useful when it comes to printing the value of a variable or a (simple) line, but that's all there is to it. printf can basically do what the C version of it can do.

Example usage and capabilities:

Echo

echo "*** Backup shell script ***" echo echo "Runtime: $(date) @ $(hostname)" echo 

printf

vech="bike" printf "%s\n" $vech 

Sources:

NlightNFotis
  • 7.7k
  • 7
  • 34
  • 38