Skip to content

[bug] '|| ! case ... esac' parse: syntax error near unexpected token 'esac' (modernish bin/modernish:1589 _Msh_hardenBracket) #257

Closed

Description

@caomengxuan666

Found by: wt5/omb lane, #252 follow-up (next blocker after #256). modernish bin/modernish @ 63bdae0 line 1580-1589:

_Msh_hardenBracket() {
	PATH=$DEFPATH command [ "$@" 	|| ! case $? in
	( 1 )	;;
	( * )	die "command failed: [ $@" ;;
	esac
}

rubash: line 1589: syntax error near unexpected token 'esac' → init aborts rc=2. GNU Bash 5.3.0 parses it.

Minimal probe (LF file): a negated case command after || :
fn() { true || ! case $? in ( 0 ) ;; ( * ) echo bad ;; esac; }
fn; echo "negcase-ok rc=$?"

GNU: negcase-ok rc=0. rubash: syntax error near 'esac'. GNU owner: parse.y — '!' is a pipeline prefix (reserved_word acceptable) and a case command is a compound command valid as a pipeline element (parse.y:2599+ case_command in the pipeline grammar).

Artifacts: target/issue-suites/results/wt5-omb/issue-probes/ (wt5/omb worktree).

Activity

  1. added
    bug
    on Sep 27, 2026
  2. added 2 commits that reference this issue on Sep 27, 2026
  3. caomengxuan666 commented on Sep 28, 2026

    @caomengxuan666
    MemberAuthor

    已修复并合入 master(commit 2c126128/d1e598e0,lane wt6/shell2;验证:modernish .t 166/166 rc 向量满分(原 159/164)、bats filter.bats 全平价 6/6、#273 大小写修完零快照漂移、regression 24/24)。后续边界已开单跟踪。感谢报告!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions