Skip to content

Commit 02b4e15

Browse files
committed
unskip
1 parent 9946bf4 commit 02b4e15

37 files changed

+80
-136
lines changed

PROJECT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,14 @@ xargs — build argument lists
260260
- But only read files from disk once the user actually wants to read them
261261
- Make this a new directory
262262

263-
## All before this is done
264-
265-
Woohoo
266-
267263
## Implementation phase 19
268264

269265
Find documentation for all bash commannds and builtins, grammar, functionality, semantics, etc. ideally in markdown or text or similar form and copy it into /tmp/official-bash-docs/$sourceDomain
270266

271267
## Implementation phase 20
272268

273269
- Implement which and proper PATH to resolve commands
270+
271+
## All before this is done
272+
273+
Woohoo

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@
6464
"minimatch": "^10.1.1",
6565
"sprintf-js": "^1.1.3",
6666
"turndown": "^7.2.2"
67-
}
67+
},
68+
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81"
6869
}

src/commands/which/which.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ export const whichCommand: Command = {
3333
showAll = true;
3434
silent = true;
3535
} else if (arg.startsWith("-") && arg !== "-") {
36-
// Unknown option - ignore like real which
37-
continue;
3836
} else {
3937
names.push(arg);
4038
}

src/spec-tests/KNOWN_LIMITATIONS.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The `shopt -s globskipdots` option is not implemented.
2424

2525
## Builtins
2626

27-
### read options (39 tests)
27+
### read options (24 tests)
2828
Advanced `read` options are not implemented:
2929
- `-n N` / `-N N` - read N characters
3030
- `-d delim` - custom delimiter
@@ -45,9 +45,6 @@ The `hash` builtin for managing the command hash table is not implemented.
4545
### history (29 tests)
4646
The `history` builtin and history expansion are not implemented.
4747

48-
### which (31 tests)
49-
The `which` command is not implemented (use `command -v` instead).
50-
5148
## Variables
5249

5350
### PIPESTATUS (11 tests)
@@ -72,10 +69,11 @@ Automatic file descriptor allocation with `{fd}>file` syntax is not implemented.
7269
### Close/move syntax (8 tests)
7370
File descriptor close (`>&-`, `<&-`) and move (`>&N-`) syntax is not implemented.
7471

75-
### Advanced redirections (9 tests)
72+
### Advanced redirections (10 tests)
7673
- `exec N<file` - opening specific file descriptors
7774
- `N<&M` - duplicating file descriptors
7875
- Read-write mode `<>` (3 tests)
76+
- Stderr output inside command block with stdout redirect (1 test)
7977

8078
### FD propagation (1 test)
8179
File descriptor inheritance across statements is not fully implemented.
@@ -91,8 +89,11 @@ Symlink operations including:
9189
### File time comparison (3 tests)
9290
`-ot` (older than), `-nt` (newer than), `-ef` (same file) test operators are not implemented.
9391

94-
### Permission denied execution (2 tests)
95-
Execution permission checking for scripts is not fully implemented.
92+
### Permission denied execution (3 tests)
93+
Execution permission checking for scripts is not fully implemented. Returns exit code 127 instead of 126.
94+
95+
### Ambiguous redirect (1 test)
96+
Redirect to `"$@"` with multiple arguments should produce "ambiguous redirect" error.
9697

9798
## Arithmetic
9899

@@ -115,7 +116,7 @@ Comments inside `$((...))` are not supported.
115116

116117
## Parameter Expansion
117118

118-
### Right brace in default value (75 tests)
119+
### Right brace in default value (54 tests)
119120
Complex parameter expansions with `}` in default values like `${x:-a}b}` have parsing limitations.
120121

121122
### ${@:0:N} slice (5 tests)
@@ -146,7 +147,7 @@ Complex escaped braces in expansion are not handled.
146147

147148
## Control Flow
148149

149-
### errexit in compound commands (21 tests)
150+
### errexit in compound commands (9 tests)
150151
`set -e` (errexit) doesn't interact correctly with:
151152
- Brace groups `{ }`
152153
- Pipelines
@@ -206,9 +207,12 @@ The `%(format)T` strftime format is not implemented.
206207

207208
## Parsing
208209

209-
### Parse error detection (16 tests)
210+
### Parse error detection (11 tests)
210211
Some parse error messages and detection differ from bash.
211212

213+
### Nested array literal (1 test)
214+
`a=( inside=() )` should be a parse error but is not detected.
215+
212216
### Newlines in compound lists (1 test)
213217
Newline handling in some compound command contexts.
214218

src/spec-tests/cases/arith.test.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ should not get here
9797
## N-I bash/mksh/zsh status: 0
9898

9999
#### Integer constant parsing
100-
## SKIP: Comments in arithmetic expansion not implemented
101100
echo $(( 0x12A ))
102101
echo $(( 0x0A ))
103102
echo $(( 0777 ))
@@ -348,14 +347,12 @@ echo $((array[1] + array[2]*3))
348347
## N-I dash stdout-json: ""
349348

350349
#### Constants in base 36
351-
## SKIP: Comments in arithmetic expansion not implemented
352350
echo $((36#a))-$((36#z))
353351
## stdout: 10-35
354352
## N-I dash stdout-json: ""
355353
## N-I dash status: 2
356354

357355
#### Constants in bases 2 to 64
358-
## SKIP: which command not implemented
359356
# This is a truly bizarre syntax. Oh it comes from zsh... which allows 36.
360357
echo $((64#a))-$((64#z)), $((64#A))-$((64#Z)), $((64#@)), $(( 64#_ ))
361358
## stdout: 10-35, 36-61, 62, 63
@@ -365,14 +362,12 @@ echo $((64#a))-$((64#z)), $((64#A))-$((64#Z)), $((64#@)), $(( 64#_ ))
365362
## N-I mksh/zsh status: 1
366363

367364
#### Multiple digit constants with base N
368-
## SKIP: Comments in arithmetic expansion not implemented
369365
echo $((10#0123)), $((16#1b))
370366
## stdout: 123, 27
371367
## N-I dash stdout-json: ""
372368
## N-I dash status: 2
373369

374370
#### Dynamic base constants
375-
## SKIP: Comments in arithmetic expansion not implemented
376371
base=16
377372
echo $(( ${base}#a ))
378373
## stdout: 10
@@ -459,7 +454,6 @@ max positive = 2147483647
459454
## END
460455

461456
#### More 64-bit ops
462-
## SKIP: 64-bit integer edge cases not implemented
463457
case $SH in dash) exit ;; esac
464458

465459
#shopt -s strict_arith
@@ -572,7 +566,6 @@ echo $(( 3 ** 2 ))
572566
## N-I mksh status: 1
573567

574568
#### Exponentiation operator has buggy precedence
575-
## SKIP: which command not implemented
576569
# NOTE: All shells agree on this, but R and Python give -9, which is more
577570
# mathematically correct.
578571
echo $(( -3 ** 2 ))
@@ -629,7 +622,6 @@ echo $((array + 5))
629622
## N-I mksh/zsh stdout-json: ""
630623

631624
#### Add integer to associative array (a[0] decay)
632-
## SKIP: Associative array value coercion in arithmetic not implemented
633625
typeset -A assoc
634626
assoc[0]=42
635627
echo $((assoc + 5))
@@ -691,7 +683,6 @@ declared
691683
## N-I dash stdout-json: ""
692684

693685
#### comma operator
694-
## SKIP: which command not implemented
695686
a=(4 5 6)
696687

697688
# zsh and osh can't evaluate the array like that

src/spec-tests/cases/array.test.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ argv.py "${a[3]}"
7676
## stdout: ['']
7777

7878
#### Negative index
79-
## SKIP: Right brace in parameter default value not implemented
8079
a=(1 '2 3')
8180
argv.py "${a[-1]}" "${a[-2]}" "${a[-5]}" # last one out of bounds
8281
## stdout: ['2 3', '1', '']
8382
## N-I mksh stdout: ['', '', '']
8483

8584
#### Negative index and sparse array
86-
## SKIP: Right brace in parameter default value not implemented
8785
a=(0 1 2 3 4)
8886
unset a[1]
8987
unset a[4]
@@ -121,7 +119,6 @@ echo ${a[@]}
121119
## END
122120

123121
#### Negative index and sparse array
124-
## SKIP: Right brace in parameter default value not implemented
125122
a=(0 1)
126123
unset 'a[-1]' # remove last element
127124
a+=(2 3)
@@ -854,7 +851,6 @@ bash: line 2: a[-1]: bad array subscript
854851

855852

856853
#### Regression: Negative index in [[ -v a[index] ]]
857-
## SKIP: Array negative index error messages with line numbers not implemented
858854
a[0]=x
859855
a[5]=y
860856
a[10]=z
@@ -942,7 +938,6 @@ bash: line 4: unset: [-2]: bad array subscript
942938

943939

944940
#### Regression: Out-of-bound negative offset for ${a[@]:offset}
945-
## SKIP: Right brace in parameter default value not implemented
946941
case $SH in mksh) exit ;; esac
947942

948943
a=(1 2 3 4)

src/spec-tests/cases/assign.test.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ eggs
267267

268268

269269
#### Modify a temporary binding
270-
## SKIP: Temp binding edge cases not implemented
271270
# (regression for bug found by Michael Greenberg)
272271
f() {
273272
echo "x before = $x"
@@ -375,7 +374,6 @@ x=global
375374
## END
376375

377376
#### Using ${x-default} after unsetting local shadowing a global
378-
## SKIP: Right brace in parameter default value not implemented
379377
f() {
380378
echo "x=$x"
381379
local x='local'
@@ -635,7 +633,6 @@ STDERR
635633
## END
636634

637635
#### redirect after declare -p
638-
## SKIP: which command not implemented
639636
case $SH in *dash) exit 99 ;; esac # stderr unpredictable
640637

641638
foo=bar

src/spec-tests/cases/brace-expansion.test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ echo -{\X"b",'cd'}-
5050
## stdout: -Xb- -cd-
5151

5252
#### expansion with simple var
53-
## SKIP: Brace expansion with variables order not implemented
5453
a=A
5554
echo -{$a,b}-
5655
## stdout: -A- -b-

src/spec-tests/cases/builtin-bracket.test.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ true
214214
## END
215215

216216
#### operator/operand ambiguity with ]
217-
## SKIP: which command not implemented
218217
# bash parses this as '-z' AND ']', which is true. It's a syntax error in
219218
# dash/mksh.
220219
[ -z -a ] ]
@@ -530,7 +529,6 @@ status=2
530529
## END
531530

532531
#### -nt -ot
533-
## SKIP: File time/inode comparison (-ot, -nt, -ef) not implemented
534532
[ present -nt absent ] || exit 1
535533
[ absent -ot present ] || exit 2
536534
## status: 1
@@ -557,7 +555,6 @@ different
557555
## END
558556

559557
#### Overflow error
560-
## SKIP: 64-bit integer edge cases not implemented
561558
test -t 12345678910
562559
echo status=$?
563560
## STDOUT:

src/spec-tests/cases/builtin-cd.test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ target
239239
## stderr-json: ""
240240

241241
#### Test the current directory after 'cd ..' involving symlinks
242-
## SKIP: Symbolic links (ln -s) not implemented
243242
dir=$TMP/symlinktest
244243
mkdir -p $dir
245244
cd $dir

0 commit comments

Comments
 (0)