Last active
December 14, 2015 14:29
-
-
Save xxjapp/5101138 to your computer and use it in GitHub Desktop.
Use only one line eithor in bash script file or command line to display a digital clock. This line also shows some useful tricks in bash script
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
# Use only one line eithor in bash script file or command line to display a digital clock. | |
# This line also shows in bash script | |
# - A example of endless loop | |
# - Assigning output of command to a variable | |
# - "-n" "-e" of echo command | |
# - "\r" is used to reset the current line output | |
while sleep 1; do o=$(date); echo -n -e "\r$o"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
monitor last file information
while sleep 1; do o=$(ll | tail -1); echo -n -e "\r$o"; done