nsh icon indicating copy to clipboard operation
nsh copied to clipboard

several POSIX-compliance issues

Open oguz-ismail opened this issue 3 years ago • 1 comments

  • variable assignments where the value to be assigned is an empty string don't work, such as
    foo=
    
  • redirections can't be applied to brace groups (and perhaps other compound commands):
    { :; } >&2
    
  • the last case item in a case list has to be terminated explicitly, otherwise it won't work:
    case x in
    x) foo
    esac
    
  • case items where the pattern is enclosed in a pair of parens don't work either:
    case x in
    (x) foo ;;
    esac
    
  • pattern matching parameter expansions don't work at all:
    foo=bar
    echo ${foo#}
    
  • when invoked with -c, the shell doesn't accept positional parameters:
    nsh -c '' nsh 1 2 3
    

I didn't test any further than this.

oguz-ismail avatar Nov 18 '21 05:11 oguz-ismail

Nice catch! I enjoyed this list of bugs. Will fix it.

nuta avatar Nov 18 '21 11:11 nuta