This commit is contained in:
onceupon 2016-07-27 10:34:04 +08:00 committed by GitHub
parent 12370acf8a
commit 35656ea015

View File

@ -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