NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Invoking bc with defaults



On Tue, Nov 13, 2012 at 10:04 AM, herbert langhans 
<w3%langhans.com.pl@localhost> wrote:

> Precision should be four after the comma, but floating point would be
> quite acceptable too. The only thing I found is the option scale=4 - but
> I have to type it in every time after invoking bc.
>
> And at last - there doesnt seem to be an option for .bc or .bc.conf or
> anything. Is there any method to invoke bc with some settings?

Create a file  ~/bc.conf with your desired settings (like your
mentioned scale=4).
Start bc with this file as argument and force interactive mode:
  bc -i bc.conf
This will evaluate bc.conf and instead of quitting after EOF it will drop you to
a bc prompt for further evaluation.
You may add an alias or a wrapper script for this at your will.

Ralf


Home | Main Index | Thread Index | Old Index