mirror of
				https://github.com/onceupon/Bash-Oneliner.git
				synced 2025-11-03 22:51:07 +01:00 
			
		
		
		
	add sed
This commit is contained in:
		@@ -158,6 +158,7 @@ sed -i '$ s/.$//' filename
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#####add string to end of file (e.g. "]")
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
sed '$s/$/]/' filename
 | 
			
		||||
```
 | 
			
		||||
@@ -173,6 +174,12 @@ sed -e 's/$/\}\]/' filename
 | 
			
		||||
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)
 | 
			
		||||
    
 | 
			
		||||
```bash
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user