-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48c00e1
commit a92582f
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Commonly used commands with this file: | ||
# bash --version | ||
# cat eg_echo.sh | ||
# bash eg_echo.sh | ||
|
||
echo 'Executing file: '$0 | ||
|
||
echo Hello, world | ||
|
||
# To get rid of the automatically inserted \n with -n flag | ||
echo -n 'Hello, world' | ||
|
||
# printf in Bash | ||
echo # add a termination charater to compensate previous -n flag | ||
printf '%s = %d\n' 'Line' $LINES | ||
|
||
# - sign forces to allign to the left | ||
printf '%-10.10s = %5.3f\n' 'Const PI' 3.14159265359 | ||
# without -sign, alligns to the right | ||
printf '%10.10s = %5.3f\n' 'Const PI' 3.14159265359 |