Summary: | sysutils/bsdstats: 300.statistics outputs an error message: expr: not a decimal number: ' 43905' | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | KOIE Hidetaka <koie> | ||||||
Component: | Individual Port(s) | Assignee: | Eitan Adler <eadler> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Only Me | ||||||||
Priority: | Normal | ||||||||
Version: | Latest | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
KOIE Hidetaka
2011-09-06 07:00:03 UTC
KOIE Hidetaka <koie@suri.co.jp> writes: > --- 300.statistics.orig 2011-09-06 14:30:53.572040919 +0900 > +++ 300.statistics 2011-09-06 14:32:56.860042305 +0900 > @@ -171,7 +171,7 @@ > > > # Make the request > - string_length=`echo ${query_string} | wc -m` > + string_length=`echo ${query_string} | wc -m | sed 's/^ *//'` > string_length=`expr ${string_length} - 1` > > echo "POST ${url_prefix}/scripts/report_ports.php HTTP/1.0 Why not just eliminate expr(1) rather than trying to conform to its quirks? from expr(1) man page: The syntax of the expr command in general is historic and inconvenient. New applications are advised to use shell arithmetic rather than expr. and later · Leading white space and/or a plus sign before an otherwise valid positive numberic operand are allowed and will be ignored. After r223881 this does not seem to be true $ expr -- ' 1' + 1 expr: not a decimal number: ' 1' Exit 2 $ expr -e -- ' 1' + 1 2 default behavior is similar to `expr' from GNU coreutils $ gexpr -- ' 1' + 1 gexpr: non-integer argument Exit 2 http://svnweb.freebsd.org/base?view=revision&revision=223881 I agree on using builtin arith, and I misunderstood the problem. Responsible Changed From-To: freebsd-ports-bugs->eadler I'll take it. State Changed From-To: open->analyzed - eadler 2011-09-25 21:35:26 UTC FreeBSD ports repository Modified files: sysutils/bsdstats Makefile sysutils/bsdstats/files 300.statistics.in Log: - use shell arithmetic instead of expr PR: ports/160504 Submitted by: KOIE Hidetaka <koie@suri.co.jp> Submitted by: h h <aakuusta@gmail.com> Approved by: bapt (mentor) Revision Changes Path 1.62 +1 -1 ports/sysutils/bsdstats/Makefile 1.45 +2 -2 ports/sysutils/bsdstats/files/300.statistics.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" State Changed From-To: analyzed->closed Committed. Thanks! |