Skip to main content
added 2 characters in body
Source Link
GAD3R
  • 69.9k
  • 32
  • 147
  • 216

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:

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:

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:

added missing quotes
Source Link
Stéphane Chazelas
  • 586.2k
  • 96
  • 1.1k
  • 1.7k

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"$vech" 

Sources:

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:

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:

edited body
Source Link
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:

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:

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:

Source Link
NlightNFotis
  • 7.7k
  • 7
  • 34
  • 38
Loading