mirror of https://gitlab.com/curben/blog
				
				
				
			Add example of unzip stdin
This commit is contained in:
		
							parent
							
								
									4f40f5b85a
								
							
						
					
					
						commit
						d897263163
					
				| 
						 | 
					@ -46,5 +46,5 @@ So, Alpine uses BusyBox and Ubuntu uses GNU. While Ubuntu also bundles with Busy
 | 
				
			||||||
I tested the tools on Alpine and Ubuntu, and noted their behaviour. BusyBox = BB.
 | 
					I tested the tools on Alpine and Ubuntu, and noted their behaviour. BusyBox = BB.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- **gzip/gunzip/zcat**: BB only support gzip/bzip2/xz format, not the ubiquitous zip. To extract, use **unzip**. GNU supports zip, but its zcat can only extract the first file.
 | 
					- **gzip/gunzip/zcat**: BB only support gzip/bzip2/xz format, not the ubiquitous zip. To extract, use **unzip**. GNU supports zip, but its zcat can only extract the first file.
 | 
				
			||||||
- **unzip**: GNU doesn't support stdin as input. Use funzip to decompress stdin, but only extract the first file like zcat. BB support stdin and extract all files.
 | 
					- **unzip**: GNU doesn't support stdin as input. Use funzip to decompress stdin, but only extract the first file like zcat. BB support stdin and extract all files, through `unzip -`.
 | 
				
			||||||
- **sed**: BB doesn't support -z argument which is used to find/replace \n new line character. A [workaround](https://stackoverflow.com/a/1252191) is `sed ':a;N;$!ba;s/\n/<new character>/g' file` or `sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/<new character>/g' file`. GNU `sed -z 's/\n/<new character>/g' ` works.
 | 
					- **sed**: BB doesn't support -z argument which is used to find/replace \n new line character. A [workaround](https://stackoverflow.com/a/1252191) is `sed ':a;N;$!ba;s/\n/<new character>/g' file` or `sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/<new character>/g' file`. GNU `sed -z 's/\n/<new character>/g' ` works.
 | 
				
			||||||
		Loading…
	
		Reference in New Issue