I'm trying to use the comparison operator of bc
and I'm getting a "syntax error on line 1 stdin" error. I need to use the comparison functionality within a korn script because korn doesn't handle floating points well. Example usage below:
echo "scale=2; 3.2 > 3" | bc
bc
? I get a similar error using plan9port's bc while everything works fine with FreeBSD's. (My error, for comparison, issyntax error:1, <nil>
and also happens when I don't redirect stdin (i.e., usebc
directly) and when I don't use floats.) – sr_ Oct 25 '11 at 15:18bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
– Barun Feb 23 '12 at 18:21