mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-29 15:46:35 +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
|
```bash
|
||||||
for line in $(cat myfile); do echo $line; read -n1; done
|
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
|
## Variable
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-oneliner-commands)]
|
||||||
|
Loading…
Reference in New Issue
Block a user