From 41f898aa9501ffb1675127e5d2408d4affee7782 Mon Sep 17 00:00:00 2001 From: onceupon Date: Wed, 25 Oct 2017 14:43:51 +0800 Subject: [PATCH] add loop for loop, print a file line by line --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 588f226..9174223 100644 --- a/README.md +++ b/README.md @@ -768,6 +768,13 @@ for i in $(ls); do echo file $i;done for i in $(cat tpc_stats_0925.log |grep failed|grep -o '\query\w\{1,2\}');do cat ${i}.log; read -rsp $'Press any key to continue...\n' -n1 key;done ``` +##### for loop, print a file line by line +```bash +for line in $(cat myfile); do echo $line; read -n1; done +``` + + + ## Math [[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)] ##### Print out the prime factors of a number (e.g. 50)