mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-29 15:46:35 +00:00
add sed
This commit is contained in:
parent
e69ac89075
commit
64086e080f
12
README.md
12
README.md
@ -146,9 +146,19 @@ sed 's/^$/d'
|
|||||||
sed '$d'
|
sed '$d'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#####delete last character from end of file
|
||||||
|
```bash
|
||||||
|
sed -i '$ s/.$//' filename
|
||||||
|
```
|
||||||
|
|
||||||
|
#####add string to end of file (e.g. "]")
|
||||||
|
```bash
|
||||||
|
sed '$s/$/]/' filename
|
||||||
|
```
|
||||||
|
|
||||||
#####add string to end of each line (e.g. "}")
|
#####add string to end of each line (e.g. "}")
|
||||||
```bash
|
```bash
|
||||||
sed -e 's/$/\}\]/'
|
sed -e 's/$/\}\]/' filename
|
||||||
```
|
```
|
||||||
|
|
||||||
#####add \n every nth character (e.g. every 4th character)
|
#####add \n every nth character (e.g. every 4th character)
|
||||||
|
Loading…
Reference in New Issue
Block a user