buninu 0.3.0 → 0.4.0
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/CHANGELOG.md +71 -0
- package/README.md +334 -37
- package/apps/bunmsh/CHANGELOG.md +262 -0
- package/apps/bunmsh/LICENSE +21 -0
- package/apps/bunmsh/LICENSE-MKSH +295 -0
- package/apps/bunmsh/PORTING.md +192 -0
- package/apps/bunmsh/README.md +801 -0
- package/apps/bunmsh/bunmsh +7 -0
- package/apps/bunmsh/bunshell.md +61 -0
- package/apps/bunmsh/help/README.md +1945 -0
- package/apps/bunmsh/help/alias.md +22 -0
- package/apps/bunmsh/help/basename.md +38 -0
- package/apps/bunmsh/help/builtin.md +25 -0
- package/apps/bunmsh/help/bun.md +27 -0
- package/apps/bunmsh/help/bunmsh.md +47 -0
- package/apps/bunmsh/help/cat.md +31 -0
- package/apps/bunmsh/help/catfancy.md +35 -0
- package/apps/bunmsh/help/cd.md +22 -0
- package/apps/bunmsh/help/chmod.md +27 -0
- package/apps/bunmsh/help/clear.md +21 -0
- package/apps/bunmsh/help/colon.md +22 -0
- package/apps/bunmsh/help/command.md +27 -0
- package/apps/bunmsh/help/cp.md +28 -0
- package/apps/bunmsh/help/cut.md +25 -0
- package/apps/bunmsh/help/date.md +25 -0
- package/apps/bunmsh/help/dirname.md +25 -0
- package/apps/bunmsh/help/echo.md +25 -0
- package/apps/bunmsh/help/env.md +27 -0
- package/apps/bunmsh/help/eval.md +22 -0
- package/apps/bunmsh/help/exec.md +22 -0
- package/apps/bunmsh/help/exit.md +21 -0
- package/apps/bunmsh/help/export.md +22 -0
- package/apps/bunmsh/help/false.md +22 -0
- package/apps/bunmsh/help/find.md +33 -0
- package/apps/bunmsh/help/getopts.md +28 -0
- package/apps/bunmsh/help/grep.md +34 -0
- package/apps/bunmsh/help/head.md +27 -0
- package/apps/bunmsh/help/kill.md +27 -0
- package/apps/bunmsh/help/ln.md +28 -0
- package/apps/bunmsh/help/ls.md +37 -0
- package/apps/bunmsh/help/lsbun.md +29 -0
- package/apps/bunmsh/help/lsfancy.md +37 -0
- package/apps/bunmsh/help/md5sum.md +21 -0
- package/apps/bunmsh/help/mkdir.md +27 -0
- package/apps/bunmsh/help/mktemp.md +26 -0
- package/apps/bunmsh/help/mv.md +26 -0
- package/apps/bunmsh/help/print.md +30 -0
- package/apps/bunmsh/help/printf.md +25 -0
- package/apps/bunmsh/help/pwd.md +21 -0
- package/apps/bunmsh/help/read.md +27 -0
- package/apps/bunmsh/help/readonly.md +27 -0
- package/apps/bunmsh/help/realpath.md +21 -0
- package/apps/bunmsh/help/rm.md +33 -0
- package/apps/bunmsh/help/rmdir.md +27 -0
- package/apps/bunmsh/help/sed.md +29 -0
- package/apps/bunmsh/help/seq.md +29 -0
- package/apps/bunmsh/help/serve.md +50 -0
- package/apps/bunmsh/help/set.md +26 -0
- package/apps/bunmsh/help/sha256sum.md +21 -0
- package/apps/bunmsh/help/shift.md +23 -0
- package/apps/bunmsh/help/sleep.md +25 -0
- package/apps/bunmsh/help/sort.md +29 -0
- package/apps/bunmsh/help/source.md +23 -0
- package/apps/bunmsh/help/tab.md +30 -0
- package/apps/bunmsh/help/tac.md +29 -0
- package/apps/bunmsh/help/tail.md +27 -0
- package/apps/bunmsh/help/tee.md +25 -0
- package/apps/bunmsh/help/test.md +30 -0
- package/apps/bunmsh/help/time.md +29 -0
- package/apps/bunmsh/help/touch.md +26 -0
- package/apps/bunmsh/help/tr.md +26 -0
- package/apps/bunmsh/help/true.md +22 -0
- package/apps/bunmsh/help/type.md +21 -0
- package/apps/bunmsh/help/umask.md +22 -0
- package/apps/bunmsh/help/unalias.md +28 -0
- package/apps/bunmsh/help/uname.md +31 -0
- package/apps/bunmsh/help/unset.md +28 -0
- package/apps/bunmsh/help/wc.md +27 -0
- package/apps/bunmsh/help/whence.md +26 -0
- package/apps/bunmsh/help/which.md +41 -0
- package/apps/bunmsh/help/yes.md +23 -0
- package/apps/bunmsh/package.json +26 -0
- package/apps/bunmsh/serve.js +468 -0
- package/apps/bunmsh/single-exe/README.md +402 -0
- package/apps/bunmsh/single-exe/assetsHelper.js +371 -0
- package/apps/bunmsh/single-exe/assetsLoader.mjs +85 -0
- package/apps/bunmsh/single-exe/assetsPacker.js +218 -0
- package/apps/bunmsh/single-exe/compiled.js +527 -0
- package/apps/bunmsh/single-exe/entry.mjs +17 -0
- package/apps/bunmsh/src/cat-fancy.js +117 -0
- package/apps/bunmsh/src/cat-operands.js +31 -0
- package/apps/bunmsh/src/completion.js +247 -0
- package/apps/bunmsh/src/environment.js +61 -0
- package/apps/bunmsh/src/fancy-ls.js +186 -0
- package/apps/bunmsh/src/find.js +119 -0
- package/apps/bunmsh/src/history.js +198 -0
- package/apps/bunmsh/src/main.js +776 -0
- package/apps/bunmsh/src/mouse.js +103 -0
- package/apps/bunmsh/src/shell.js +3557 -0
- package/apps/bunmsh/test/catfancy.test.js +102 -0
- package/apps/bunmsh/test/reference-source.sh +1 -0
- package/apps/bunmsh/test/reference.test.js +677 -0
- package/apps/bunmsh/test/serve/README.md +3 -0
- package/apps/bunmsh/test/serve/bad.json +1 -0
- package/apps/bunmsh/test/serve/data.json +1 -0
- package/apps/bunmsh/test/serve/data.json5 +1 -0
- package/apps/bunmsh/test/serve/data.jsonc +2 -0
- package/apps/bunmsh/test/serve/data.jsonl +2 -0
- package/apps/bunmsh/test/serve/data.ndjson +1 -0
- package/apps/bunmsh/test/serve/data.toml +3 -0
- package/apps/bunmsh/test/serve/data.ts +15 -0
- package/apps/bunmsh/test/serve/data.xml +1 -0
- package/apps/bunmsh/test/serve/data.yaml +3 -0
- package/apps/bunmsh/test/serve/data.yml +1 -0
- package/apps/bunmsh/test/serve.test.js +241 -0
- package/apps/bunmsh/test/shell.test.js +1778 -0
- package/apps/bunmsh/test/t.sh +12 -0
- package/apps/cmdlist +6 -1
- package/apps/jsgotty/gotty.js +65 -76
- package/apps/jsgotty/package.json +6 -1
- package/apps/jsgotty/single-exe/README.md +358 -54
- package/apps/jsgotty/single-exe/assetsHelper.js +293 -12
- package/apps/jsgotty/single-exe/assetsLoader.mjs +1 -1
- package/apps/jsgotty/single-exe/assetsPacker.js +218 -0
- package/apps/jsgotty/single-exe/compiled.js +379 -19
- package/apps/jsgotty/single-exe/entry.mjs +16 -2
- package/apps/jsgotty/zmodem-node.js +14 -12
- package/apps/jsmdcui/CHANGELOG.md +56 -0
- package/apps/jsmdcui/package.json +12 -2
- package/apps/jsmdcui/single-exe/README.md +298 -375
- package/apps/jsmdcui/single-exe/assetsHelper.js +198 -18
- package/apps/jsmdcui/single-exe/assetsLoader.mjs +1 -1
- package/apps/jsmdcui/single-exe/assetsPacker.js +218 -0
- package/apps/jsmdcui/single-exe/compiled.js +291 -5
- package/apps/jsmdcui/single-exe/entry.mjs +7 -0
- package/apps/jsmdcui/src/index.js +11 -8
- package/apps/jsmdcui/tests/jmigt.js +16 -0
- package/bin/bunmsh.bat +3 -0
- package/bin/bunmsh.sh +5 -0
- package/bin/init.js +48 -5
- package/bin/install.js +541 -0
- package/package.json +4 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## alias
|
|
2
|
+
|
|
3
|
+
Define or print aliases.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
alias [NAME[=VALUE] ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Example
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
alias ll='builtin lsfancy -l'
|
|
15
|
+
alias ll
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Output:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
ll='builtin lsfancy -l'
|
|
22
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
## basename
|
|
2
|
+
|
|
3
|
+
Remove directory components and an optional suffix.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
basename [--] STRING [SUFFIX]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `--`: Stop option parsing, allowing a string beginning with `-`.
|
|
14
|
+
- `SUFFIX`: Remove this exact suffix when it is present and is not the whole basename.
|
|
15
|
+
|
|
16
|
+
### Example
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
basename /usr/local/bin/bun
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Output:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
bun
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Suffix example:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
basename archive.tar.gz .gz
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Output:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
archive.tar
|
|
38
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## builtin
|
|
2
|
+
|
|
3
|
+
Run a registered builtin explicitly; with no command, list builtin names.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
builtin [--] [COMMAND [ARG ...]]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `--`: Stop builtin's own option parsing before the command name.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
builtin echo hello
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Output:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
hello
|
|
25
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## bun
|
|
2
|
+
|
|
3
|
+
Invoke the active Bun runtime.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
bun [ARG ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
All arguments are forwarded unchanged to the active Bun runtime. Bun's
|
|
14
|
+
supported flags depend on that runtime version; run the external `bun --help`
|
|
15
|
+
when its own complete CLI reference is required.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
bun --version
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Output:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
1.4.0
|
|
27
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
## bunmsh
|
|
2
|
+
|
|
3
|
+
Invoke the active bunmsh entry point.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
bunmsh [ARG ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `SCRIPT [ARG ...]`: Execute a shell script file.
|
|
14
|
+
- `-c SOURCE [ARG ...]`: Parse and execute shell source text.
|
|
15
|
+
- `-cc COMMAND [ARG ...]`: Execute argv directly without shell parsing or expansion.
|
|
16
|
+
- `-i`: Enter interactive mode after any requested command or script.
|
|
17
|
+
- `--mouse`: Enable terminal mouse events.
|
|
18
|
+
- `--builtin-only`: Disable PATH lookup while retaining builtins.
|
|
19
|
+
- `-V`, `--version`: Print the bunmsh version.
|
|
20
|
+
- `--readme`: Render the bundled README.
|
|
21
|
+
- `--changelog`: Render the bundled changelog.
|
|
22
|
+
- `--build-exe`: Build `./bmsh` for the current platform.
|
|
23
|
+
- `--build-for TARGET`: Cross-compile `./bmsh` for a target.
|
|
24
|
+
- `--`: Stop option parsing before a script path.
|
|
25
|
+
|
|
26
|
+
### Tar-backend asset controls
|
|
27
|
+
|
|
28
|
+
These options currently work only with the tar asset backend. They are not
|
|
29
|
+
available to builds that embed the asset directory directly with Bun's
|
|
30
|
+
`--asset` backend. See [single-exe/README.md](../single-exe/README.md) for the
|
|
31
|
+
backend comparison, build setup, and extraction layout.
|
|
32
|
+
|
|
33
|
+
- `--assets-list`: List embedded asset paths and exit.
|
|
34
|
+
- `--assets-extract`: Extract embedded assets beside the executable and exit.
|
|
35
|
+
- `--assets-external`: Ignore embedded assets and read the extracted files.
|
|
36
|
+
|
|
37
|
+
### Example
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
bunmsh -c 'echo hello'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Output:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
hello
|
|
47
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
## cat
|
|
2
|
+
|
|
3
|
+
Concatenate files or stdin.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
cat [--exclude PATTERN]... [--] [FILE ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `--`: Stop option parsing.
|
|
14
|
+
- `--exclude PATTERN`/`--exclude=PATTERN`: Omit matching file operands using
|
|
15
|
+
`Bun.Glob` patterns. Repeat the option to exclude more patterns; quote a
|
|
16
|
+
pattern to prevent the shell from expanding it first.
|
|
17
|
+
- `-`: Read from stdin at that operand position. No other options are supported.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
printf 'alpha\n' > alpha.txt
|
|
23
|
+
printf 'beta\n' > beta.txt
|
|
24
|
+
builtin cat --exclude 'alpha.*' *.txt
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Output:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
beta
|
|
31
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
## catfancy
|
|
2
|
+
|
|
3
|
+
Render Markdown and colorized parsed structured data; pass other formats through.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
catfancy [--exclude PATTERN]... [--] [FILE ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `--`: Stop option parsing.
|
|
14
|
+
- `--exclude PATTERN`/`--exclude=PATTERN`: Omit matching file operands using
|
|
15
|
+
`Bun.Glob` patterns. Repeat the option to exclude more patterns; quote a
|
|
16
|
+
pattern to prevent the shell from expanding it first.
|
|
17
|
+
- `-`: Read unformatted stdin; file previews are selected from filename extensions.
|
|
18
|
+
- `.js`/`.mjs`/`.cjs`/`.jsx` and `.ts`/`.mts`/`.cts`/`.tsx` files are wrapped
|
|
19
|
+
in a fenced ` ```javascript `/` ```typescript ` block and rendered through
|
|
20
|
+
`Bun.markdown.ansi`, for the same syntax coloring Markdown code blocks get.
|
|
21
|
+
|
|
22
|
+
### Example
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
builtin catfancy package.json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Output:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
{
|
|
32
|
+
"name": "bunmsh",
|
|
33
|
+
"version": "0.1.10"
|
|
34
|
+
} # colorized
|
|
35
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## chmod
|
|
2
|
+
|
|
3
|
+
Change modes using octal values, +x, or a+x.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
chmod MODE FILE ...
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- Octal modes such as `755` set all permission bits.
|
|
14
|
+
- `+x` and `a+x` add executable bits.
|
|
15
|
+
|
|
16
|
+
### Example
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
chmod +x script.sh
|
|
20
|
+
builtin test -x script.sh; echo $?
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Output:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
0
|
|
27
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## command
|
|
2
|
+
|
|
3
|
+
Run or inspect a command while bypassing aliases.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
command [-pVv] COMMAND [ARG ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `-p`: Use bunmsh's default command PATH.
|
|
14
|
+
- `-v`: Print a concise lookup result.
|
|
15
|
+
- `-V`: Print a verbose lookup description.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
command -V echo
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Output:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
echo is a shell builtin
|
|
27
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## cp
|
|
2
|
+
|
|
3
|
+
Copy files and directories.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
cp [-rRv] SOURCE ... DESTINATION
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `-r`, `-R`: Copy directories recursively (`-r` is translated to Bun Shell's `-R`).
|
|
14
|
+
- `-v`: Request verbose output.
|
|
15
|
+
- `-n`: Accepted by Bun Shell but currently does not prevent overwriting.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
cp source.txt copy.txt
|
|
21
|
+
cat copy.txt
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Output:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
hello
|
|
28
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## cut
|
|
2
|
+
|
|
3
|
+
Select character positions.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
cut -c LIST [FILE ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `-c LIST`, `-cLIST`: Select character positions or ranges such as `1-3,7`.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
printf 'abcdef\n' | cut -c2-4
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Output:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
bcd
|
|
25
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## date
|
|
2
|
+
|
|
3
|
+
Print the current date.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
date [+FORMAT]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- Formats include `%Y` year, `%m` month, `%d` day, `%H` hour, `%M` minute, `%S` second, `%s` Unix time, `%F` date, `%T` time, and `%%` percent.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
date +%F
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Output:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
2026-08-28
|
|
25
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## dirname
|
|
2
|
+
|
|
3
|
+
Print a path's directory component.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
dirname [--] STRING
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `--`: Stop option parsing, allowing a string beginning with `-`.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
dirname /usr/local/bin/bun
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Output:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
/usr/local/bin
|
|
25
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## echo
|
|
2
|
+
|
|
3
|
+
Write space-separated arguments.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
echo [-n] [ARG ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `-n`: Omit the trailing newline.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
echo hello world
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Output:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
hello world
|
|
25
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## env
|
|
2
|
+
|
|
3
|
+
Print or modify the environment and optionally run a command.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
env [-i] [-u NAME] [NAME=VALUE ...] [COMMAND [ARG ...]]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `-i`, `--ignore-environment`: Start with an empty environment.
|
|
14
|
+
- `-u NAME`, `--unset NAME`, `--unset=NAME`: Remove a variable.
|
|
15
|
+
- `--`: Stop option parsing.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
env NAME=value sh -c 'echo "$NAME"'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Output:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
value
|
|
27
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## exec
|
|
2
|
+
|
|
3
|
+
Run a command and terminate the current shell with its status.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
exec COMMAND [ARG ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Example
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
exec printf 'done\n'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Output:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
done
|
|
21
|
+
(shell exits with status 0)
|
|
22
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
## find
|
|
2
|
+
|
|
3
|
+
Walk paths with name, path, type, depth, print, and -exec expressions.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
find [PATH ...] [EXPRESSION]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- `-name`, `-iname`: Match a basename, optionally ignoring case.
|
|
14
|
+
- `-path`, `-ipath`: Match a path, optionally ignoring case.
|
|
15
|
+
- `-type f|d|l`: Select files, directories, or links.
|
|
16
|
+
- `-mindepth N`, `-maxdepth N`: Limit traversal depth.
|
|
17
|
+
- `-print`, `-print0`: Emit newline- or NUL-delimited paths.
|
|
18
|
+
- `!`, `-not`: Negate the following expression.
|
|
19
|
+
- `-exec COMMAND {} \;`: Run once per path.
|
|
20
|
+
- `-exec COMMAND {} +`: Run with batches of paths.
|
|
21
|
+
|
|
22
|
+
### Example
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
find . -type f -name '*.md'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Output:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
./README.md
|
|
32
|
+
./CHANGELOG.md
|
|
33
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## getopts
|
|
2
|
+
|
|
3
|
+
Parse positional options.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
getopts OPTSTRING NAME [ARG ...]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Options and forms
|
|
12
|
+
|
|
13
|
+
- A leading `:` in OPTSTRING selects silent error reporting.
|
|
14
|
+
- A letter followed by `:` requires an argument. Results use the named variable plus `OPTARG` and `OPTIND`.
|
|
15
|
+
|
|
16
|
+
### Example
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
set -- -a value
|
|
20
|
+
getopts a: option
|
|
21
|
+
echo "$option=$OPTARG"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Output:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
a=value
|
|
28
|
+
```
|