buninu-linux 0.8.55 → 0.9.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.md +46 -46
- package/README.md +7 -6
- package/initramfs/bin/tar +34 -46
- package/initramfs/buninu/apps/bunmsh/CHANGELOG.md +103 -0
- package/initramfs/buninu/apps/bunmsh/PORTING.md +133 -15
- package/initramfs/buninu/apps/bunmsh/help/awk.md +38 -0
- package/initramfs/buninu/apps/bunmsh/help/break.md +21 -0
- package/initramfs/buninu/apps/bunmsh/help/chmod.md +8 -2
- package/initramfs/buninu/apps/bunmsh/help/cmp.md +29 -0
- package/initramfs/buninu/apps/bunmsh/help/continue.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/cp.md +4 -0
- package/initramfs/buninu/apps/bunmsh/help/diff.md +30 -0
- package/initramfs/buninu/apps/bunmsh/help/egrep.md +26 -0
- package/initramfs/buninu/apps/bunmsh/help/export.md +2 -2
- package/initramfs/buninu/apps/bunmsh/help/expr.md +30 -0
- package/initramfs/buninu/apps/bunmsh/help/fgrep.md +25 -0
- package/initramfs/buninu/apps/bunmsh/help/grep.md +4 -0
- package/initramfs/buninu/apps/bunmsh/help/ls.md +4 -2
- package/initramfs/buninu/apps/bunmsh/help/mkdir.md +1 -1
- package/initramfs/buninu/apps/bunmsh/help/print.md +3 -0
- package/initramfs/buninu/apps/bunmsh/help/return.md +23 -0
- package/initramfs/buninu/apps/bunmsh/help/sed.md +8 -3
- package/initramfs/buninu/apps/bunmsh/help/set.md +12 -3
- package/initramfs/buninu/apps/bunmsh/help/tr.md +4 -0
- package/initramfs/buninu/apps/bunmsh/help/trap.md +22 -0
- package/initramfs/buninu/apps/bunmsh/help/uniq.md +27 -0
- package/initramfs/buninu/apps/bunmsh/package.json +1 -1
- package/initramfs/buninu/apps/bunmsh/src/awk.js +203 -0
- package/initramfs/buninu/apps/bunmsh/src/diff.js +222 -0
- package/initramfs/buninu/apps/bunmsh/src/fancy-ls.js +15 -4
- package/initramfs/buninu/apps/bunmsh/src/main.js +21 -5
- package/initramfs/buninu/apps/bunmsh/src/sed.js +159 -0
- package/initramfs/buninu/apps/bunmsh/src/shell.js +1283 -540
- package/initramfs/buninu/apps/bunmsh/test/awk-reference.test.js +35 -0
- package/initramfs/buninu/apps/bunmsh/test/awk.test.js +62 -0
- package/initramfs/buninu/apps/bunmsh/test/posix-bootstrap.test.js +595 -0
- package/initramfs/buninu/apps/bunmsh/test/utility-reference-cases.mjs +98 -0
- package/initramfs/buninu/apps/bunmsh/test/utility-reference.test.js +23 -0
- package/initramfs/buninu/apps/jsgotty/client-kitty.mjs +61 -0
- package/initramfs/buninu/apps/jsgotty/client.mjs +16 -0
- package/initramfs/buninu/apps/jsgotty/package-lock.json +2 -2
- package/initramfs/buninu/apps/jsgotty/package.json +1 -1
- package/initramfs/buninu/apps/jsgotty/tests/client-kitty.test.mjs +43 -0
- package/initramfs/etc/resolv.conf +2 -1
- package/initramfs/usr/share/doc/buninu-linux/tar.md +12 -1
- package/package.json +1 -1
- package/scripts/arch.js +5 -5
- package/scripts/arch.sh +5 -5
- package/scripts/fetch.js +2 -0
- package/scripts/npm-packages.md +4 -3
- package/test/fetch-npm.test.js +1 -1
- package/test/tar-strip.test.js +36 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## break
|
|
2
|
+
|
|
3
|
+
Leave N enclosing loops (default 1). N must be positive. Function calls establish their own loop boundary.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
break [N]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Example
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
for x in a b; do echo "$x"; break; done
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Output:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
a
|
|
21
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## chmod
|
|
2
2
|
|
|
3
|
-
Change modes using octal values
|
|
3
|
+
Change file modes using octal values or symbolic permission changes.
|
|
4
4
|
|
|
5
5
|
### Usage
|
|
6
6
|
|
|
@@ -11,7 +11,13 @@ chmod MODE FILE ...
|
|
|
11
11
|
### Options and forms
|
|
12
12
|
|
|
13
13
|
- Octal modes such as `755` set all permission bits.
|
|
14
|
-
- `+x`
|
|
14
|
+
- `+x` retains its existing shorthand for adding executable bits for everyone.
|
|
15
|
+
- Explicit classes `u`, `g`, `o`, or `a` support `+`, `-`, and `=` with `rwxX`.
|
|
16
|
+
- `X` adds execution only for directories or files already executable.
|
|
17
|
+
- Comma-separated clauses and multiple operations are applied in order.
|
|
18
|
+
- Examples: `a-w`, `u+rw`, `go=rx`, `u=rw,g=r,o=`.
|
|
19
|
+
- Recursive mode, permission copying, `s`/`t`, and omitted classes other than
|
|
20
|
+
the existing `+x` shorthand are not implemented.
|
|
15
21
|
|
|
16
22
|
### Example
|
|
17
23
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## cmp
|
|
2
|
+
|
|
3
|
+
Compare two files byte by byte. Return 0 for identical data, 1 for differences,
|
|
4
|
+
and 2 for errors. `-` reads standard input.
|
|
5
|
+
|
|
6
|
+
### Usage
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
cmp [-s] [--] FILE1 FILE2
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`-s` (also `--silent` or `--quiet`) suppresses difference and file-error messages.
|
|
13
|
+
Without it, report the first differing byte and line, or which file ends first.
|
|
14
|
+
Byte offsets, `-l`, and other GNU extensions are not implemented.
|
|
15
|
+
|
|
16
|
+
### Example
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
printf same > first
|
|
20
|
+
printf same > second
|
|
21
|
+
cmp -s first second
|
|
22
|
+
echo $?
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Output:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
0
|
|
29
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## continue
|
|
2
|
+
|
|
3
|
+
Continue the Nth enclosing loop (default 1). N must be positive.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
continue [N]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Example
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
for x in a b; do echo "$x"; continue; echo skipped; done
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Output:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
a
|
|
21
|
+
b
|
|
22
|
+
```
|
|
@@ -6,12 +6,16 @@ Copy files and directories.
|
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
cp [-rRv] SOURCE ... DESTINATION
|
|
9
|
+
cp -p [-v] [--] FILE ... DESTINATION
|
|
9
10
|
```
|
|
10
11
|
|
|
11
12
|
### Options and forms
|
|
12
13
|
|
|
13
14
|
- `-r`, `-R`: Copy directories recursively (`-r` is translated to Bun Shell's `-R`).
|
|
14
15
|
- `-v`: Request verbose output.
|
|
16
|
+
- `-p`: Preserve regular-file ownership, permissions and access/modification
|
|
17
|
+
times. Multiple sources require a directory destination; recursive `-p`
|
|
18
|
+
combinations are not yet supported and report an error.
|
|
15
19
|
- `-n`: Accepted by Bun Shell but currently does not prevent overwriting.
|
|
16
20
|
|
|
17
21
|
### Example
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
## diff
|
|
2
|
+
|
|
3
|
+
Compare two files. Return 0 when identical, 1 when different, or 2 on error.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
diff [-q] [--] FILE1 FILE2
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Print normal-format changes, or use `-q`/`--brief` for a difference notice.
|
|
12
|
+
Binary differences produce a notice. Text differences use Myers line alignment, preserving unchanged lines
|
|
13
|
+
between separate additions, deletions, and replacements. Missing final
|
|
14
|
+
newlines are reported explicitly. Directory comparison and unified/context formats are not supported.
|
|
15
|
+
The default shell alias's `--color` option is accepted; output is plain text.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
printf 'first\nlast\n' > before
|
|
21
|
+
printf 'first\nnew\nlast\n' > after
|
|
22
|
+
diff before after
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Output:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
1a2
|
|
29
|
+
> new
|
|
30
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
## egrep
|
|
2
|
+
|
|
3
|
+
Search using extended regular expressions, equivalent to `grep -E`.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
egrep [OPTIONS] PATTERN [FILE ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
Accepts the same supported options as builtin `grep`.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
printf 'red\nblue\ngreen\n' | builtin egrep 'red|blue'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Output:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
red
|
|
25
|
+
blue
|
|
26
|
+
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
## export
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Mark variables for export, or list them. In `set -o posix` mode, external programs receive only inherited/exported variables and command-prefix assignments. Shell pipelines and subshells retain all shell variables through internal state transfer. Outside POSIX mode, bunmsh preserves its default of passing all variables to external programs.
|
|
4
4
|
|
|
5
5
|
### Usage
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
export [NAME[=VALUE] ...]
|
|
8
|
+
export [-p] [NAME[=VALUE] ...]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
### Example
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
## expr
|
|
2
|
+
|
|
3
|
+
Evaluate integer, string, and basic regular-expression expressions.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
expr [--] EXPRESSION
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- Arithmetic: `+`, `-`, `*`, `/`, `%`, with parentheses and precedence.
|
|
14
|
+
- Comparisons: `=`, `!=`, `<`, `<=`, `>`, `>=`.
|
|
15
|
+
- `|` selects the first nonempty, nonzero operand; `&` requires both operands.
|
|
16
|
+
- `STRING : BRE` returns the first capture, or the matched prefix length when there is no capture.
|
|
17
|
+
- Status is 0 for a nonempty, nonzero result, 1 for empty or zero, and 2 for an error.
|
|
18
|
+
- Quote operators that the shell would otherwise interpret.
|
|
19
|
+
|
|
20
|
+
### Example
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
expr 2 + 3 '*' 4
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Output:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
14
|
|
30
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## fgrep
|
|
2
|
+
|
|
3
|
+
Search for fixed strings, equivalent to `grep -F`.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
fgrep [OPTIONS] PATTERN [FILE ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
Accepts the same supported options as builtin `grep`.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
printf 'a.b\naxb\n' | builtin fgrep 'a.b'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Output:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
a.b
|
|
25
|
+
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
## ls
|
|
2
2
|
|
|
3
|
-
Use the lsfancy emoji and terminal-width-aware listing.
|
|
3
|
+
Use the lsfancy emoji and terminal-width-aware listing. With `set -o posix`, fallback `ls` omits icons and automatic directory suffixes. Explicit `-F` suffixes still apply; `lsfancy` always retains its icons.
|
|
4
4
|
|
|
5
5
|
### Usage
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
ls [-
|
|
8
|
+
ls [-aAdilhLRtrS1F] [PATH ...]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Because `-h` means human-readable sizes, use `--help` to display this page.
|
|
@@ -16,6 +16,8 @@ Because `-h` means human-readable sizes, use `--help` to display this page.
|
|
|
16
16
|
- `-A`: Include hidden entries except `.` and `..`.
|
|
17
17
|
- `-d`: List directories themselves rather than their contents.
|
|
18
18
|
- `-l`: Use long format.
|
|
19
|
+
- `-i`: Print inode numbers.
|
|
20
|
+
- `-L`: Follow symbolic links.
|
|
19
21
|
- `-h`: Show human-readable sizes; use `--help` for this page.
|
|
20
22
|
- `-R`: Recurse into directories.
|
|
21
23
|
- `-t`: Sort by modification time.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## return
|
|
2
|
+
|
|
3
|
+
Return from a function or sourced script. Without STATUS, preserve the previous status.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
return [STATUS]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Example
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
f () { return 7; }
|
|
15
|
+
f
|
|
16
|
+
echo "$?"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Output:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
7
|
|
23
|
+
```
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
## sed
|
|
2
2
|
|
|
3
|
-
Apply
|
|
3
|
+
Apply editing commands to pattern and hold spaces.
|
|
4
4
|
|
|
5
5
|
### Usage
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
sed [-nEr] [-e SCRIPT] [-i] [SCRIPT] [FILE ...]
|
|
8
|
+
sed [-nEr] [-e SCRIPT | -f FILE] [-i] [SCRIPT] [FILE ...]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
### Options and forms
|
|
12
12
|
|
|
13
13
|
- `-n`: Suppress automatic output.
|
|
14
14
|
- `-e SCRIPT`, `-eSCRIPT`: Add a script.
|
|
15
|
+
- `-f FILE`, `-fFILE`: Read a script from a file.
|
|
15
16
|
- `-E`, `-r`: Use extended regular expressions.
|
|
16
17
|
- `-i`: Edit files in place.
|
|
17
|
-
-
|
|
18
|
+
- Numeric, last-line (`$`), and regular-expression addresses; ranges, inversion, and `{ ... }` groups.
|
|
19
|
+
- `s///` with `g`, `p`, and occurrence-number flags; `y///` translation.
|
|
20
|
+
- `p`, `P`, `d`, `D`, `q`, `=`, `n`, `N`; hold-space commands `h`, `H`, `g`, `G`, `x`.
|
|
21
|
+
- Labels (`:`), unconditional branches (`b`), and substitution-test branches (`t`, `T`).
|
|
22
|
+
- `a`, `i`, `c` text commands; `r FILE` appends file contents after the current cycle. Missing/unreadable files are skipped. This remains a subset: `w` is not implemented.
|
|
18
23
|
|
|
19
24
|
### Example
|
|
20
25
|
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
## set
|
|
2
2
|
|
|
3
|
-
Print variables
|
|
3
|
+
Print variables, replace positional parameters, or change shell options.
|
|
4
4
|
|
|
5
5
|
### Usage
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
set [-- [ARG ...]]
|
|
8
|
+
set [-eufxv] [+eufxv] [-o NAME | +o NAME] [-- [ARG ...]]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
### Options and forms
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- No arguments: print variables.
|
|
14
|
+
- `--`: replace positional parameters, including clearing them with no following arguments.
|
|
15
|
+
- `-`: end options and disable verbose/xtrace; replace positional parameters only when arguments follow.
|
|
16
|
+
- `-e` / `+e`: enable/disable exit on untested failures. Conditions, negation and non-final AND/OR commands suppress it.
|
|
17
|
+
- `-u` / `+u`: enable/disable errors for unset parameters; explicit defaults still work.
|
|
18
|
+
- `-f` / `+f`: disable/enable pathname expansion.
|
|
19
|
+
- `-x` / `+x`: enable/disable execution tracing.
|
|
20
|
+
- `-o` / `+o` without a name: list named option states / reusable set commands.
|
|
21
|
+
- Names: `errexit`, `nounset`, `noglob`, `xtrace`, `verbose`, `posix`. CLI `-v` prints initial input; incremental verbose reading is not yet implemented.
|
|
22
|
+
- `-o posix`: enable compatibility mode. The fallback `ls` prints without icons or automatic directory suffixes; `lsfancy` remains decorative. External programs receive only inherited/exported variables and command-prefix assignments; pipelines and subshells still receive complete shell state. Use `+o posix` to restore the default, which passes all variables to external programs. This option is not a guarantee of complete POSIX semantics.
|
|
14
23
|
|
|
15
24
|
### Example
|
|
16
25
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## trap
|
|
2
|
+
|
|
3
|
+
Register shell code for EXIT (0) or a catchable signal. No operands lists handlers; ACTION - resets and an empty ACTION ignores the signal in this shell. Signal handlers are deferred to command boundaries. Background process ownership is unchanged.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
trap [ACTION SIGNAL ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Example
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
trap 'echo done' 0
|
|
15
|
+
exit 0
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Output:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
done
|
|
22
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## uniq
|
|
2
|
+
|
|
3
|
+
Collapse adjacent equal lines without sorting. Comparisons preserve bytes.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
uniq [-cdu] [--] [INPUT [OUTPUT]]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`-c` prefixes counts; `-d` selects repeated groups; `-u` selects single lines.
|
|
12
|
+
`-` reads standard input or writes standard output. Missing final newlines
|
|
13
|
+
are added. Field/character skipping and other GNU options are unsupported.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
printf 'a\na\nb\na\n' | uniq
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Output:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
a
|
|
25
|
+
b
|
|
26
|
+
a
|
|
27
|
+
```
|