expr say "non integer argument"

2010-02-18 Thread jidanni
$ expr 3.1 + 3
expr: non-numeric argument <---say "non integer argument"
$ expr 3.1 + 3b
expr: non-numeric argument




Re: expr say "non integer argument"

2010-02-18 Thread Chris F.A. Johnson
On Thu, 18 Feb 2010, jida...@jidanni.org wrote:

> $ expr 3.1 + 3
> expr: non-numeric argument <---say "non integer argument"
> $ expr 3.1 + 3b
> expr: non-numeric argument

   The expr command's arithmetic only works with integers.

   3.1 is not an integer, nor is 3b.

   To do calculations with decimal fractions, I recommend awk.

-- 
   Chris F.A. Johnson  
   ===
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)




Re: expr say "non integer argument"

2010-02-18 Thread jidanni
> "CFAJ" == Chris F A Johnson  writes:
CFAJ> On Thu, 18 Feb 2010, jida...@jidanni.org wrote:

>> $ expr 3.1 + 3
>> expr: non-numeric argument <---say "non integer argument"
>> $ expr 3.1 + 3b
>> expr: non-numeric argument

CFAJ>The expr command's arithmetic only works with integers.
Yes
CFAJ>3.1 is not an integer, nor is 3b.
Yes
CFAJ>To do calculations with decimal fractions, I recommend awk.
Yes.
3,1 is numeric!




Re: expr say "non integer argument"

2010-02-18 Thread Chris F.A. Johnson
On Thu, 18 Feb 2010, jida...@jidanni.org wrote:

> > "CFAJ" == Chris F A Johnson  writes:
> CFAJ> On Thu, 18 Feb 2010, jida...@jidanni.org wrote:
> 
> >> $ expr 3.1 + 3
> >> expr: non-numeric argument <---say "non integer argument"
> >> $ expr 3.1 + 3b
> >> expr: non-numeric argument
> 
> CFAJ>The expr command's arithmetic only works with integers.
> Yes
> CFAJ>3.1 is not an integer, nor is 3b.
> Yes
> CFAJ>To do calculations with decimal fractions, I recommend awk.
> Yes.
> 3,1 is numeric!

   But it is NOT an integer, and expr only handles integers. 

-- 
   Chris F.A. Johnson  
   ===
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)




Re: expr say "non integer argument"

2010-02-18 Thread Eric Blake
According to Chris F.A. Johnson on 2/18/2010 6:20 AM:
> On Thu, 18 Feb 2010, jida...@jidanni.org wrote:
> 
>> $ expr 3.1 + 3
>> expr: non-numeric argument <---say "non integer argument"
>> $ expr 3.1 + 3b
>> expr: non-numeric argument
> 
>The expr command's arithmetic only works with integers.

But that's not his point.  The point is that 3.1 is numeric, so the error
could be fine-tuned to state that expr expects integers to make it clear
that numeric but non-integer is the reason for the failure.  And I'm
inclined to agree.  I see nothing in POSIX that requires the current error
string, or forbids a more specific error string.

jidanni, it would be a two-line patch to expr.c.  Would you care to write
such a patch, rather than just complaining?

-- 
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net



signature.asc
Description: OpenPGP digital signature


Re: expr say "non integer argument"

2010-02-18 Thread jidanni
EB> jidanni, it would be a two-line patch to expr.c.  Would you care to write
EB> such a patch, rather than just complaining?

It would be much more efficient for me to just play the role of the bug
reporter here trust me. Thanks.




Re: expr say "non integer argument"

2010-02-18 Thread Chris F.A. Johnson
On Thu, 18 Feb 2010, Eric Blake wrote:

> According to Chris F.A. Johnson on 2/18/2010 6:20 AM:
> > On Thu, 18 Feb 2010, jida...@jidanni.org wrote:
> > 
> >> $ expr 3.1 + 3
> >> expr: non-numeric argument <---say "non integer argument"
> >> $ expr 3.1 + 3b
> >> expr: non-numeric argument
> > 
> >The expr command's arithmetic only works with integers.
> 
> But that's not his point.  The point is that 3.1 is numeric, so the error
> could be fine-tuned to state that expr expects integers to make it clear
> that numeric but non-integer is the reason for the failure.

   My apologies; I should have read it more closely. That'll teach me
   to post early in the morning!

>  And I'm inclined to agree. I see nothing in POSIX that requires the
> current error string, or forbids a more specific error string.

   I agree.


-- 
   Chris F.A. Johnson  
   ===
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)




Re: expr say "non integer argument"

2010-02-18 Thread jidanni
CFAJ> That'll teach me to post early in the morning!
The problem is that you live in the incorrect timezone :-|




Re: expr say "non integer argument"

2010-02-18 Thread Eric Blake
According to jida...@jidanni.org on 2/18/2010 6:54 AM:
> EB> jidanni, it would be a two-line patch to expr.c.  Would you care to write
> EB> such a patch, rather than just complaining?
> 
> It would be much more efficient for me to just play the role of the bug
> reporter here trust me. Thanks.

You are giving up too easily.  Your bug reports would go a LOT further if
you would show some effort behind them.  What's so hard about:

sed -i 's/non-numeric/non-integer/' src/expr.c

It results in this diff:

diff --git a/src/expr.c b/src/expr.c
index 048c596..1ebb4b9 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -787,7 +787,7 @@ eval4 (bool evaluate)
   if (evaluate)
 {
   if (!toarith (l) || !toarith (r))
-error (EXPR_INVALID, 0, _("non-numeric argument"));
+error (EXPR_INVALID, 0, _("non-integer argument"));
   if (fxn != multiply && mpz_sgn (r->u.i) == 0)
 error (EXPR_INVALID, 0, _("division by zero"));
   ((fxn == multiply ? mpz_mul
@@ -824,7 +824,7 @@ eval3 (bool evaluate)
   if (evaluate)
 {
   if (!toarith (l) || !toarith (r))
-error (EXPR_INVALID, 0, _("non-numeric argument"));
+error (EXPR_INVALID, 0, _("non-integer argument"));
   (fxn == plus ? mpz_add : mpz_sub) (l->u.i, l->u.i, r->u.i);
 }
   freev (r);


Now all that's lacking is a changelog-style commit message, and you're done.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net



signature.asc
Description: OpenPGP digital signature


Re: expr say "non integer argument"

2010-02-18 Thread jidanni
$ diff --git
diff: unrecognized option '--git'<--see my next email coming soon.
$ dlocate src/expr.c|wc
  0   0   0

Actually at one point I was much more involved.
http://article.gmane.org/gmane.comp.version-control.git/103400

However today its
bash: git: command not found
for me, as I'm intent on taking it easy.




diff "--git"

2010-02-18 Thread jidanni
$ diff --git
diff: unrecognized option '--git'

I think diff should say at this point "real diff, at least up to year
2010, does not have a --git option, you are probably getting that idea
from git output" or something.

Or ask those git pros for a patch to give diff a --git option, or tell
them that they are overstepping their bounds...




Re: diff "--git"

2010-02-18 Thread Alfred M. Szmidt
   $ diff --git
   diff: unrecognized option '--git'

   I think diff should say at this point "real diff, at least up to year
   2010, does not have a --git option, you are probably getting that idea
   from git output" or something.

That is what it says, though not in so many words.  Having an option
for each VS would really be a headache (SCCS, RCS, CVS, hg, darcs,
bzr, tla, git, ...).




Re: diff "--git"

2010-02-18 Thread jidanni
AMS> That is what it says, though not in so many words.  Having an option
AMS> for each VS would really be a headache (SCCS, RCS, CVS, hg, darcs,
AMS> bzr, tla, git, ...).

Well all I know is we then harangue the system administrator for not
installing the latest diff that the other guys are already using... when
in fact they are not using diff at all and diff --git would fail on
their machine too because they have boldly invented a fantasy unlike any
other seen there on the command line...

So maybe there should be a general disclaimer added about some people
spreading false rumors about diff options...




RE: expr say "non integer argument"

2010-02-18 Thread Voelker, Bernhard
Eric Blake wrote:

> -error (EXPR_INVALID, 0, _("non-numeric argument"));
> +error (EXPR_INVALID, 0, _("non-integer argument"));
...
> -error (EXPR_INVALID, 0, _("non-numeric argument"));
> +error (EXPR_INVALID, 0, _("non-integer argument"));

Maybe a dumb question:
Why's the error message hardcoded?
Isn't there localization for this error message?

Have a nice day,
Berny




Re: Final point in new option of join

2010-02-18 Thread Pádraig Brady

On 16/02/10 00:09, Pádraig Brady wrote:



+sc_option_desc_uppercase:
+ @$(MAKE) -C src $@
+ @$(MAKE) -C man $@


I've pushed with the above changed to:

@$(MAKE) -s -C src all_programs
@$(MAKE) -s -C man $@

The -s is defined by POSIX and is available
on linux/BSD/solaris at least, and makes
the output from `make syntax-check` much cleaner.
I might add it to all syntax-check sub makes.


With the following, `make syntax-check` now just
outputs the name of each rule unless there is an issue:

commit 7dd4725bd682523792bb28ee9e71dfe778922e39
Author: Pádraig Brady 
Date:   Thu Feb 18 08:38:30 2010 +

maint: clean up the output from syntax-check rules

* cfg.mk (sc_tight_scope): Pass the -s (silent) flag to `make`
so that it doesn't report about calling sub makes.
(sc_check-AUTHORS): Likewise.
(sc_strftime_check): Don't display stderr from info.
* src/Makefile.am (sc_tight_scope): Don't annotate with "GEN".
(sc_check-AUTHORS): Likewise.

diff --git a/cfg.mk b/cfg.mk
index 3f2e6d3..71f3d85 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -165,11 +165,11 @@ sc_sun_os_names:

 ALL_RECURSIVE_TARGETS += sc_tight_scope
 sc_tight_scope:
-   @$(MAKE) -C src $@
+   @$(MAKE) -s -C src $@

 ALL_RECURSIVE_TARGETS += sc_check-AUTHORS
 sc_check-AUTHORS:
-   @$(MAKE) -C src $@
+   @$(MAKE) -s -C src $@

 # Option descriptions should not start with a capital letter
 # One could grep source directly as follows:
@@ -218,7 +218,7 @@ sc_strftime_check:
  grep '^  %.  ' $(srcdir)/src/date.c | sort\
| $(extract_char) > $...@-src; \
  { echo N; \
-   info libc date calendar format | grep '^`%.'\'  \
+   info libc date calendar format 2>/dev/null|grep '^`%.'\'\
  | $(extract_char); } | sort > $...@-info;\
  diff -u $...@-src $...@-info || exit 1; \
  rm -f $...@-src $...@-info; \
diff --git a/src/Makefile.am b/src/Makefile.am
index feb6c22..ecb42a8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -678,7 +678,7 @@ au_dotdot = authors-dotdot
 au_actual = authors-actual
 .PHONY: sc_check-AUTHORS
 sc_check-AUTHORS: $(all_programs)
-   $(AM_V_GEN)locale=en_US.UTF-8;  \
+   @locale=en_US.UTF-8;\
LC_ALL="$$locale" ./cat --version   \
| grep ' Torbjorn ' > /dev/null \
  && { echo "$@: skipping this check"; exit 0; }; \
@@ -714,7 +714,7 @@ sc_check-AUTHORS: $(all_programs)
 # The second nm|grep checks for file-scope variables with `extern' scope.
 .PHONY: sc_tight_scope
 sc_tight_scope: $(bin_PROGRAMS)
-   $(AM_V_GEN)t=exceptions-;   \
+   @t=exceptions-; \
trap "s=$$?; rm -f $$t; exit $$s" 0 1 2 13 15;  \
src=`for f in $(SOURCES); do\
   test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`;   \




[bug #26512] ls: it's no longer possible to change the default (NORMAL) text color

2010-02-18 Thread Pádraig Brady

Update of bug #26512 (project coreutils):

  Status:None => Fixed  
 Assigned to:None => pixelbeat  

___

Follow-up Comment #1:

Fixed with commit f5268e27
http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=f5268e2749d5649a3364550ef54bf31d9aa9c4e1

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/





Re: expr say "non integer argument"

2010-02-18 Thread Eric Blake
According to Voelker, Bernhard on 2/18/2010 8:31 AM:
>> -error (EXPR_INVALID, 0, _("non-numeric argument"));
>> +error (EXPR_INVALID, 0, _("non-integer argument"));
> 
> Maybe a dumb question:
> Why's the error message hardcoded?

It isn't.

> Isn't there localization for this error message?

Yep - _("...") is the localization.  It is a macro that calls gettext, and
gettext does all the work of translating it according to your locale
environment variables.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net



signature.asc
Description: OpenPGP digital signature