mirror of
https://github.com/onceupon/Bash-Oneliner
synced 2024-11-22 20:54:19 +00:00
add loop
for loop, print a file line by line
This commit is contained in:
parent
945fce1dd6
commit
41f898aa95
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue