[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH] dc: support GNU dc options (-e/--expression -f/--file)
From: wdlkmpx <wdlkmpx () gmail ! com>
Date: 2018-04-05 19:52:18
Message-ID: CADm8ZdU+gVLjvKWy9_Ppddd+8n3vhSuzZ+Qyx7aRpyAwnrgy6A () mail ! gmail ! com
[Download RAW message or body]
I see the patch title might be misleading.. this just adds a
compatibility layer through -e and -f, but does not implement any
additional DC commands. In fact i'm reading the gnu dc manual for the
first time ahaha.
The busybox dc can be considered a subset of the gnu dc.. with a few
incompatibilies... the gnu dc does not recognize 'add mul mod div' but
'+ * % /' etc.. the busybox dc recognizes both..
Testing the patch..
In this quick test providing the same "portable" params you can see
that both dc's behave the same..
However this is something i just found out:
The busybox dc expects a EXPRESSION if no -opts are provided.. this is
the default behavior that is not changing... but the gnu dc expects a
FILE if no -opts are provided...
// BUSYBOX DC
# ./busybox dc "10 10 * p"
100
# ./busybox dc -e
dc: option requires an argument -- 'e'
...
# ./busybox dc -e "10 10 * p"
100
# ./busybox dc --expression=
# ./busybox dc --expresion="10 10 * p"
100
# echo "10 10 * p" > dc.in
# ./busybox dc -f dc.in
100
# ./busybox dc --file=
dc: : No such file or directory
# ./busybox dc --file=dc.in
100
# ./busybox dc -a
dc: invalid option -- 'a'
// GNU DC
# dc "10 10 * p"
dc: Could not open file 10 10 * p
# dc -e
dc: option requires an argument -- 'e'
.....
# dc -e "10 10 * p"
100
# dc --expression=
# dc --expression="10 10 * p"
100
# echo "10 10 * p" > dc.in
# dc -f dc.in
100
# dc --file=
dc: Could not open file
# dc --file=dc.in
100
# dc -a
dc: invalid option -- 'a'
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic