From: Ronald F. <yn...@mm...> - 2013-08-24 09:20:54
|
On Tue, Aug 20, 2013, at 7:31, YAMANO Yuji wrote: > It comes from the jython bash script, not python code. You might want to > add -x to the beginning of the line in ~/jython2.5.4rc1/jython to see > what's happening. > > On Wed, 07 Aug 2013 19:23:32 +0200, Ronald Fischer <yn...@mm...> wrote: > > expr: syntax error > > Jython 2.5.4rc1 (2.5:723492dbab02, Feb 8 2013, 09:50:55) > > Any idea where this syntax error comes from? Thanks for the hint. I researched it and found that it was indeed a bug in the bash script. There is a line saying: if expr "$link" : '/' > /dev/null; then and this indeed yields a syntax error. The reason is a somewhat arcane restriction of the "expr" command. From its man-page: 'The expr utility makes no lexical distinction between arguments which may be operators and arguments which may be operands. An operand which is lexically identical to an operator will be considered a syntax error.' Indeed, after changing this line to if expr "$link" : '[/]' > /dev/null; then no error anymore. It is interesting, that this restriction to 'expr' doesn't seem to be published widely. The expr man page of MacOSX 10.4 (which I am using) doesn't mention it, but the documentation for Darwin explain it here: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/expr.1.html It is documented in the BSD documentation (which, AFIK, is where Mac OSX is derived from), but the expr found on Linux doesn't have it. This is probably the reason why the bug got unnoticed for long time. -- Ronald Fischer <ro...@em...> + If a packet hits a pocket on a socket on a port, + and the bus is interrupted and the interrupt's not caught, + then the socket packet pocket has an error to report. + (cited after Peter van der Linden) |