mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-29 23:56:36 +00:00
add sed
This commit is contained in:
parent
12370acf8a
commit
35656ea015
@ -158,6 +158,7 @@ sed -i '$ s/.$//' filename
|
|||||||
```
|
```
|
||||||
|
|
||||||
#####add string to end of file (e.g. "]")
|
#####add string to end of file (e.g. "]")
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sed '$s/$/]/' filename
|
sed '$s/$/]/' filename
|
||||||
```
|
```
|
||||||
@ -173,6 +174,12 @@ sed -e 's/$/\}\]/' filename
|
|||||||
sed 's/.\{4\}/&\n/g'
|
sed 's/.\{4\}/&\n/g'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#####concatenate/combine/join files with a seperator and next line (e.g seperate by ",")
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sed -s '$a,' *.json > all.json
|
||||||
|
```
|
||||||
|
|
||||||
#####substitution (e.g. replace A by B)
|
#####substitution (e.g. replace A by B)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
Loading…
Reference in New Issue
Block a user