brsh 3.10.6 → 3.10.7

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.10.7](https://github.com/eliotstocker/Brsh-JS/compare/v3.10.6...v3.10.7) (2026-11-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * enhanced POSIX compatibility ([076650d](https://github.com/eliotstocker/Brsh-JS/commit/076650d1e7db7d43502f389517879b8faca6ada9))
7
+
1
8
  ## [3.10.6](https://github.com/eliotstocker/Brsh-JS/compare/v3.10.5...v3.10.6) (2026-11-28)
2
9
 
3
10
 
@@ -41,15 +41,15 @@ Track progress toward a POSIX-compliant `sh` implementation in Brsh-JS.
41
41
  - [x] `$?` — last exit code
42
42
  - [x] `$#` — positional parameter count
43
43
  - [x] `$1` … `$n` — positional parameters
44
- - [ ] `$@` — all positional params as separate words
45
- - [ ] `$*` — all positional params as single word
44
+ - [x] `$@` — all positional params as separate words *(`"$@"` in scripts, functions and `for` lists; expands to nothing with no args)*
45
+ - [x] `$*` — all positional params joined into one word *(unquoted form tested; `"$*"` not separately verified)*
46
46
  - [ ] `$0` — script / shell name
47
47
  - [ ] `$$` — current PID *(can be faked)*
48
- - [ ] `${var:-default}` — use default if unset/empty
49
- - [ ] `${var:=default}` — assign default if unset/empty
50
- - [ ] `${var:?error}` — error if unset/empty
51
- - [ ] `${var:+alt}` — use alt if set
52
- - [ ] `${#var}` — string length
48
+ - [x] `${var:-default}` — use default if unset/empty *(defaults may contain quotes, `$VAR` and `$(...)`; the colon-less `${var-default}` forms behave identically since empty variables are stored as unset)*
49
+ - [x] `${var:=default}` — assign default if unset/empty
50
+ - [x] `${var:?error}` — error if unset/empty *(fails the command; does not yet exit a non-interactive shell)*
51
+ - [x] `${var:+alt}` — use alt if set
52
+ - [x] `${#var}` — string length
53
53
  - [ ] `${var#pattern}` — strip shortest prefix
54
54
  - [ ] `${var##pattern}` — strip longest prefix
55
55
  - [ ] `${var%pattern}` — strip shortest suffix
@@ -58,7 +58,8 @@ Track progress toward a POSIX-compliant `sh` implementation in Brsh-JS.
58
58
  - [ ] `${var//from/to}` — replace all *(non-POSIX but common)*
59
59
 
60
60
  ### Expansion
61
- - [x] Command substitution `$(cmd)`
61
+ - [x] Command substitution `$(cmd)` (nested quotes, parens and `;` `&&` `||` `|` inside are respected; output is never re-expanded)
62
+ - [x] Single quotes and `\$` keep `$` literal
62
63
  - [x] Arithmetic expansion `$((expr))` (both `$VAR` and bare `VAR` forms)
63
64
  - [ ] Tilde expansion (`~`, `~user`)
64
65
  - [ ] Filename glob expansion (`*`, `?`, `[a-z]`)
@@ -102,13 +103,13 @@ Track progress toward a POSIX-compliant `sh` implementation in Brsh-JS.
102
103
  - [x] `grep`
103
104
  - [ ] `wc`
104
105
  - [ ] `head`
105
- - [ ] `tail`
106
+ - [x] `tail` *(`-n`, `-c`, `+N`, legacy `-N`, multiple files, stdin; `-f` ignored)*
106
107
  - [ ] `sort`
107
108
  - [ ] `uniq`
108
109
  - [ ] `tr`
109
110
  - [ ] `cut`
110
111
  - [ ] `tee` *(requires pipe support)*
111
- - [ ] `sed`
112
+ - [x] `sed` *(s with g/p/i/N flags, d, p, q, y, `=`, line/`$`/regex addresses, ranges, `!`, `-n`, `-e`, `-E`/`-r`, BRE by default; no a/i/c, `{}` blocks, hold space, `-f` or `-i`)*
112
113
  - [ ] `awk`
113
114
 
114
115
  ### Filesystem
@@ -139,7 +140,7 @@ Track progress toward a POSIX-compliant `sh` implementation in Brsh-JS.
139
140
  - [x] `which`
140
141
  - [x] `true`
141
142
  - [x] `false`
142
- - [x] `read`
143
+ - [x] `read` (`-r`, backslash escapes and line continuation, multiple names, `IFS` splitting, `-n`, `-p`, `-t`; escaped separators still split, empty `IFS` unreachable from the shell)
143
144
  - [x] `alias`
144
145
  - [x] `exit`
145
146
 
@@ -149,12 +150,12 @@ Track progress toward a POSIX-compliant `sh` implementation in Brsh-JS.
149
150
 
150
151
  1. **Input redirect (`<`)** — needed for many real scripts
151
152
  2. **`shift` / `unset` / `:`** — small special builtins, high frequency in scripts
152
- 3. **`$@` / `$*` / `$0`** — needed for argument-forwarding patterns
153
- 4. **`${var:-default}` parameter expansion forms** — very common in real scripts
154
- 5. **`wc`, `head`, `tail`, `sort`, `uniq`, `tr`, `cut`** — most-used text utilities
153
+ 3. **`$0`** — script / shell name (currently expands to empty in scripts)
154
+ 4. **`${var#pat}` / `${var%pat}` pattern removal** — the remaining common parameter expansion forms
155
+ 5. **`wc`, `head`, `sort`, `uniq`, `tr`, `cut`** — most-used text utilities
155
156
  6. **`basename` / `dirname`** — common path helpers
156
157
  7. **`local`** — function-scoped variables
157
158
  8. **`date`, `sleep`** — misc utilities
158
159
  9. **`set -u` enforcement** — nounset mode
159
160
  10. **Glob expansion** — needed for `ls *.txt` style usage
160
- 11. **`sed` / `awk`** — complex; consider wasm or partial implementation
161
+ 11. **`awk`**, and the missing `sed` pieces (`a`/`i`/`c`, blocks, `-i`) — complex; consider wasm or partial implementation