Sample Header Ad - 728x90

Append to a pipe and pass on?

47 votes
6 answers
71055 views
I have a simple bash function dividing two numbers: echo "750/12.5" | bc I'd like to take the output from bc and append /24 and pipe said result to another instance of bc. Something like: echo "750/12.5" | bc | echo $1 + "/24" | bc Where $1 is the piped result. *P.S. I realize I could just do echo "750/12.5/24" | bc my question is more in regards to the appending of text to a pipe result.*
Asked by Philip Kirkbride (10746 rep)
Apr 22, 2017, 12:00 AM
Last activity: Sep 21, 2023, 09:22 AM