2

I have the following problem that I have not resolved for a long time now. We have a Linux (x86_64 GNU/Linux) server and a Solaris (SunOS 5.10 i86pc Solaris) server where I work. On the linux server, the command bc -l gives me a calculator where I can easily work with the numerals and commands, along with using the left and right arrows to navigate. Using the up/down arrows gives me the history of my commands. It's another story on Solaris though. The arrow keys do not work at all. I cannot edit the line, nor can I get the history. Can someone here please help me set up the proper configuration of bc on the Solaris OS?

8
  • You'll probably need bc compiled with readline support: gnu.org/software/bc/manual/html_chapter/bc_7.html Solaris may have GNU bc available (I haven't used it for a long time, so I don't remember). Commented Oct 6, 2014 at 20:43
  • I am not a root user. So the only way is to download and compile my own version of bc? Could yiu suggest a link to a proper source? Commented Oct 6, 2014 at 20:45
  • I downloaded bc-1.06 and tried to compiled. With option --with-realine it is not complied, with --with-weditline it is complied but get me segmentation fault when I am running it. Commented Oct 6, 2014 at 21:01
  • It's --with-editline, without a w, I think (and that needs a BSD library, unlikely to be present. Do you have any GNU utility installed on your system? If not, try compiling GNU readline as well. Commented Oct 6, 2014 at 21:04
  • Yes, I just made a typo here. But even so it does not work for me.;( I resolved the segmentation problem but the final compiled version with --with-editline still gets me the same problem. Commented Oct 6, 2014 at 21:12

1 Answer 1

1

The bc that comes with Solaris is quite historic.

To get the same bc feeling as on Linux just install the gbc OpenCSW package.

4
  • OP doesn't have root access. Can this package be installed by a user locally? Commented Oct 7, 2014 at 20:08
  • I am sorry for tiresomeness but I am not so good in all these packages. When I click there I finally get the same bc source I already tried to compile. Commented Oct 7, 2014 at 20:18
  • @muru, short answer: no Commented Oct 7, 2014 at 20:30
  • It's probably not historic, but Unix. Commented Oct 7, 2014 at 21:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.