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:
		
							
								
								
									
										12
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								README.md
									
									
									
									
									
								
							@@ -146,9 +146,19 @@ sed 's/^$/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. "}")
 | 
			
		||||
```bash
 | 
			
		||||
sed -e 's/$/\}\]/'
 | 
			
		||||
sed -e 's/$/\}\]/' filename
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#####add \n every nth character (e.g. every 4th character)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user