Article 4ZSBX add text in the front

add text in the front

by
spalisetty
from LinuxQuestions.org on (#4ZSBX)
ubuntu@ip-172-31-92-85:~/suman$ cat floatbc.sh
#! /bin/bash
num1=20.5
num2=5
echo "$num1+$num2" | bc
echo "$num1-$num2" | bc
echo "$num1*$num2" | bc
echo "scale=2;$num1/$num2" | bc
echo "$num1%$num2" | bc
echo "scale=2;sqrt(4)" | bc -l
echo "scale=2;$num1^$num2" | bc -l
ubuntu@ip-172-31-92-85:~/suman$ ./floatbc.sh
25.5
15.5
102.5
4.10
.5
2.00
3620506.28
ubuntu@ip-172-31-92-85:~/suman$

I want to do something like this, how it can be achieved?

echo "addition:" "$num1+$num2" | bc
echo "subtraction:" "$num1-$num2" | bc

I just want to add respective text information for respective arithmetic operations.latest?d=yIl2AUoC8zA latest?i=NkFxOgfyDEA:awWTy1wOmms:F7zBnMy latest?i=NkFxOgfyDEA:awWTy1wOmms:V_sGLiP latest?d=qj6IDK7rITs latest?i=NkFxOgfyDEA:awWTy1wOmms:gIN9vFwNkFxOgfyDEA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments