We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48c00e1 commit a92582fCopy full SHA for a92582f
BashExample/eg_echo.sh
@@ -0,0 +1,22 @@
1
+#!/bin/bash
2
+
3
+# Commonly used commands with this file:
4
+# bash --version
5
+# cat eg_echo.sh
6
+# bash eg_echo.sh
7
8
+echo 'Executing file: '$0
9
10
+echo Hello, world
11
12
+# To get rid of the automatically inserted \n with -n flag
13
+echo -n 'Hello, world'
14
15
+# printf in Bash
16
+echo # add a termination charater to compensate previous -n flag
17
+printf '%s = %d\n' 'Line' $LINES
18
19
+# - sign forces to allign to the left
20
+printf '%-10.10s = %5.3f\n' 'Const PI' 3.14159265359
21
+# without -sign, alligns to the right
22
+printf '%10.10s = %5.3f\n' 'Const PI' 3.14159265359
0 commit comments