Categories
Uncategorized

Simple bash calculator

Put the following little snippet in your .bashrc/.bash_profile and you’ll have a handy little calculator: ? () { echo “$*” | bc -l; } Use like this: bash$ ? 2*2 4 Thanks textsnippets.com

Put the following little snippet in your .bashrc/.bash_profile and you’ll have a handy little calculator:

? () { echo "$*" | bc -l; }

Use like this:

bash$ ? 2*24

Thanks textsnippets.com

By Fabio Pedrazzoli Grazioli

IT Freelancer with Linux on AWS Cloud, Digital Nomad, Traveler.

Love for Healthy Living, Personal Development, Nutrition/Detox, Meditation, Zen, Yoga.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s