From 0655d01d62891ead8bb21f0d8bc8a355ebbe4d27 Mon Sep 17 00:00:00 2001 From: Nicholas Chen Date: Wed, 18 Sep 2019 21:41:04 -0400 Subject: [PATCH] Updating printf functions Updating printf functions to print numbers and floats. --- bash.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bash.md b/bash.md index ab61a3a38..9aefd8c6a 100644 --- a/bash.md +++ b/bash.md @@ -678,6 +678,12 @@ source "${0%/*}/../share/foo.sh" ```bash printf "Hello %s, I'm %s" Sven Olga #=> "Hello Sven, I'm Olga + +printf "1 + 1 = %d" 2 +#=> "1 + 1 = 2" + +printf "This is how you print a float: %f" 2 +#=> "This is how you print a float: 2.000000" ``` ### Directory of script