Package: apcalc
Version: 2.12.1.13-3
Severity: normal

What works, and what fails:

    # add 2 to index with 'for' loop (this works)
    % for f in `seq 3` ; do calc $f + 2 ; done 
            3
            4
            5

    # same code, but with a 'while read' loop (it fails)
    % seq 3 | while read f ; do calc $f + 2 ; done 
            3
            2
            3

'calc' behaves correctly at first, (it prints 3), then outputs the
index '$f' without adding 2.  Most utils aren't confused by 'while
read':

    % seq 3 | while read f ; do expr $f + 2 ; done 
    3
    4
    5

I'd guess that a variable input with 'read' is subtly different,
(how?), and that 'calc' parses the command line in an unusual way.  If
that's not a bug, then it should be documented in 'man calc'.  (It makes
it hard to pump in a big list of numbers to 'calc'.)

Hope this helps...


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-1-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash

Versions of packages apcalc depends on:
ii  apcalc-common             2.12.1.13-3    Arbitrary precision calculator (co
ii  libc6                     2.6.1-1+b1     GNU C Library: Shared libraries
ii  libncurses5               5.6+20070825-1 Shared libraries for terminal hand
ii  libreadline5              5.2-3          GNU readline and history libraries

apcalc recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to