You can create a simple Unix shell script to find the roots of a quadratic equation ( ax^2 + bx + c = 0 ). Use the formula ( x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} ). Here's a basic example in Bash:
<code class="language-bash">#!/bin/bashread -p "Enter coefficients a, b, c: " a b c d=$((b*b - 4*a*c)) if [ $d -ge 0 ]; then root1=$(echo "scale=2; (-$b + sqrt($d)) / (2 * $a)" | bc -l) root2=$(echo "scale=2; (-$b - sqrt($d)) / (2 * $a)" | bc -l) echo "Roots: $root1, $root2" else echo "No real roots." fi
</code>
Save this script as quadratic.sh, make it executable with chmod +x quadratic.sh, and run it to find the roots.
Copyright © 2026 eLLeNow.com All Rights Reserved.