From mboxrd@z Thu Jan 1 00:00:00 1970 From: usotsuki@buric.co (Steve Nickolas) Date: Fri, 12 Sep 2014 14:18:03 +0000 (UTC) Subject: [TUHS] Etymology of bc(1) In-Reply-To: <1410529036.3893715.166731793.44CF06BA@webmail.messagingengine.com> References: <877g19g8a7.fsf@gmail.com> <7A7060B7-0229-425F-BCF4-23C3669E167C@bsdimp.com> <20140911221742.GJ23708@mercury.ccil.org> <1410529036.3893715.166731793.44CF06BA@webmail.messagingengine.com> Message-ID: On Fri, 12 Sep 2014, random832 at fastmail.us wrote: > What language does the undocumented option (assuming it is supported at > all) "bc -c" generate on FreeBSD and OSX? "Standard" bc, which actually > pipes to dc, generates (obviously) dc when run in this way, but GNU bc > generates a completely different and as far as I know undocumented > language, which is handled by the execute function (in execute.c) but as > far as I know there is no way to make it accept it on standard input. > > Standard bc: > $ echo '2+2' | bc -c > 2 2+ps. > q$ > > GNU bc: > $ echo '2+2' | bc -c > @iK2:K2:+W at r > @i > $ FreeBSD 10: $ echo '2+2'|bc -c 2 2+ps. q$ (yeah, I run ash... I got a chroot with Debian and the different userlands would cause conflict if I defaulted to bash) -uso.