docs: add differences in patch utility

This commit is contained in:
curben 2018-10-31 20:14:36 +10:30
parent d6fb00ac76
commit 9e1620e7ce
1 changed files with 2 additions and 1 deletions

View File

@ -48,4 +48,5 @@ 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. Use bsdtar to extract all files. - **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. Use bsdtar to 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 -`. - **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.
- **bsdtar**: Since GNU's zcat and funzip can only extract the first file, in addition to BB's unzip, another alternative is bsdtar. bsdtar can be installed through `libarchive-tools` package. To extract zip from stdin, use `$ bsdtar -xf -`. - **bsdtar**: Since GNU's zcat and funzip can only extract the first file, in addition to BB's unzip, another alternative is bsdtar. bsdtar can be installed through `libarchive-tools` package. To extract zip from stdin, use `$ bsdtar -xf -`.
- **patch**: BB doesn't support `--backup` option. BSD doesn't support `--verbose` option.