| Anonymous | Login | Signup for a new account | 11-10-2008 11:16 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0001380 | [BusyBox] Other | major | always | 06-05-07 08:44 | 06-08-07 00:34 | ||||
| Reporter | dmaizer | View Status | public | ||||||
| Assigned To | BusyBox | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | 1.4.x | ||||||
| Summary | 0001380: /usr/bin/[ gives "[: ]: unknown operand" message | ||||||||
| Description |
We are working in an Apache (httpd 2.2.3) suexec CGI scripts environment and our CGI scripts need to provide full paths to all applets/programs used, so we have something like the following in the CGI script: if /usr/bin/[ $# -lt 1 ]; then /bin/echo "sitediag: too few arguments" /bin/echo "Try sitediag --help for more information" exit 1 fi However - this gives the error: [: ]: unknown operand Meaning that the "]" closing bracket is being recognized as an unknown operand. But of course this bracket is needed to close the test... If we remove the /usr/bin prefix from [ - then it works and gives the expected echo messages above. I tried looking at busybox code (being no expert of that code) and found the following in coreutils/test.c: if (*t_wp != NULL && *++t_wp != NULL) { bb_error_msg("%s: unknown operand", *t_wp); return 2; } My guess is that somehow using the pathname causes that condition above to be true, but I haven't been able to find out why yet (I started looking from ash.c and "lower" to see why this happens, but haven't been able to find anything meaningful so far - hopefully someone who knows the code better can provide a clue or a fix. |
||||||||
| Additional Information | |||||||||
| Attached Files | |||||||||
|
|
|||||||||
| Copyright © 2000 - 2006 Mantis Group |