| Summary: | ASH fails to handle semi-complex "test" | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Myke Smith <mykesmith1> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
This was fixed in later versions. 1.11.2 is old. Unable to move up to a newer version of BusyBox so I am not able to personally check. I will leave the resolution as is. Do you me to move this to CLOSED? CLOSED or RESOLVED, I don't see the difference |
Encountered this problem in running Oprofile's control script (opcontrol) on BusyBox 1.11.2. This shows up when you use the single character option, for instance "-d" instead of the "--dump" option. The problem occurs when you do if test -z "$2" -a "$1" = "--reset"; then running with -xv option I see using the "-d" option + test -z -a -d = --reset <<<<<<<<<< $2 evaluates to null, $1 evaluates to -d sh: --reset: unknown operand + load_module running with -xv option I see using the "--dump" option + test -z -a --dump = --reset <<<<<<<<<< $2 evaluates to null, $1 evaluates to --dump + load_module I tried as an alternative if [ \( -z "$2"\) -a \("$1" = "--reset" \) ]; then but using either the -d or --dump option I got + [ ( -z ) -a (-d = --reset) ] sh: closing paren expected The only workaround that works is: if test \( -z "$2"\) -a \("$1" = "--reset" \) ; then + test ( -z ) -a (-d = --reset ) <<<<<<<<<< $2 evaluates to null, $1 evaluates to -d + load_module + test ( -z ) -a (--dump = --reset ) <<<<<<<<<< $2 evaluates to null, $1 evaluates to --dump + load_module