mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-12-24 01:06:36 +00:00
Update README.md
This commit is contained in:
parent
722c78f339
commit
83a7ff99be
25
README.md
25
README.md
@ -447,12 +447,6 @@ awk 'BEGIN{OFS="\t"}$3="chr"$3'
|
|||||||
awk '!/bbo/' file
|
awk '!/bbo/' file
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Column subtraction
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cat file| awk -F '\t' 'BEGIN {SUM=0}{SUM+=$3-$2}END{print SUM}'
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Usage and meaning of NR and FNR
|
##### Usage and meaning of NR and FNR
|
||||||
e.g.
|
e.g.
|
||||||
fileA:
|
fileA:
|
||||||
@ -823,6 +817,18 @@ for line in $(cat myfile); do echo $line; read -n1; done
|
|||||||
```bash
|
```bash
|
||||||
factor 50
|
factor 50
|
||||||
```
|
```
|
||||||
|
##### Sum up input list (e.g. seq 10)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
seq 10|paste -sd+|bc
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Column subtraction
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cat file| awk -F '\t' 'BEGIN {SUM=0}{SUM+=$3-$2}END{print SUM}'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
##### Simple math with expr
|
##### Simple math with expr
|
||||||
```bash
|
```bash
|
||||||
@ -852,6 +858,7 @@ echo "var=5;--var"| bc
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
||||||
##### Download all from a page
|
##### Download all from a page
|
||||||
@ -1364,12 +1371,6 @@ echo $input
|
|||||||
seq 10
|
seq 10
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Sum up input list (e.g. seq 10)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
seq 10|paste -sd+|bc
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Find average of input list/file
|
##### Find average of input list/file
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
Loading…
Reference in New Issue
Block a user