mirror of
https://github.com/onceupon/Bash-Oneliner
synced 2025-03-08 17:17:18 +00:00
add system and while
While loop, keep checking a running process (e.g. perl) and start another new process (e.g. python) immetiately after it. get pid
This commit is contained in:
parent
1dece9ec82
commit
4b1d481eb8
1 changed files with 15 additions and 1 deletions
16
README.md
16
README.md
|
@ -745,6 +745,13 @@ while read a b c; do echo $(($c-$b));done < <(head filename)
|
|||
i=0; while read a b c; do ((i+=$c-$b)); echo $i; done < <(head filename)
|
||||
```
|
||||
|
||||
##### While loop, keep checking a running process (e.g. perl) and start another new process (e.g. python) immetiately after it.
|
||||
|
||||
```bash
|
||||
while [[ $(pidof perl) ]];do echo f;sleep 10;done && python timetorunpython.py
|
||||
```
|
||||
|
||||
|
||||
##### If loop
|
||||
|
||||
```bash
|
||||
|
@ -2160,7 +2167,14 @@ telnet 192.168.2.106 53
|
|||
```bash
|
||||
ifconfig eth0 mtu 9000
|
||||
```
|
||||
|
||||
##### get pid of a running process (e.g python)
|
||||
```bash
|
||||
pidof python
|
||||
```
|
||||
or
|
||||
```bash
|
||||
ps aux|grep python
|
||||
```
|
||||
|
||||
|
||||
=-=-=-=-=-A lot more coming!! =-=-=-=-=-=-=-=-=-=waitwait-=-=-=-=-=-=-=-=-=-
|
||||
|
|
Loading…
Add table
Reference in a new issue