From d89726316340eb0f5f7833daf116a8e08c98b7e0 Mon Sep 17 00:00:00 2001 From: curben Date: Sun, 14 Oct 2018 14:19:10 +1030 Subject: [PATCH] Add example of unzip stdin --- source/_posts/gnu-vs-busybox-tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_posts/gnu-vs-busybox-tools.md b/source/_posts/gnu-vs-busybox-tools.md index 2735d2d..f16dc73 100644 --- a/source/_posts/gnu-vs-busybox-tools.md +++ b/source/_posts/gnu-vs-busybox-tools.md @@ -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. - **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//g' file` or `sed -e ':a' -e 'N' -e '$!ba' -e 's/\n//g' file`. GNU `sed -z 's/\n//g' ` works. \ No newline at end of file