mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-22 12:57:01 +00:00
add loop
switch loop
This commit is contained in:
parent
2d890d0538
commit
f59986e0c0
15
README.md
15
README.md
@ -822,6 +822,21 @@ for i in $(cat tpc_stats_0925.log |grep failed|grep -o '\query\w\{1,2\}');do cat
|
||||
```bash
|
||||
for line in $(cat myfile); do echo $line; read -n1; done
|
||||
```
|
||||
##### switch (case in bash)
|
||||
```bash
|
||||
read type;
|
||||
case $type in
|
||||
'0')
|
||||
echo 'how'
|
||||
;;
|
||||
'1')
|
||||
echo 'are'
|
||||
;;
|
||||
'2')
|
||||
echo 'you'
|
||||
;;
|
||||
esac
|
||||
```
|
||||
|
||||
## Variable
|
||||
[[back to top](#handy-bash-oneliner-commands)]
|
||||
|
Loading…
Reference in New Issue
Block a user