Created
August 27, 2016 17:19
-
-
Save abrarShariar/b5e1c2543fd5cc7eaafda18bc1cef5c3 to your computer and use it in GitHub Desktop.
lab test OS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #take input as km | |
| read input_distance | |
| echo $input_distance "km" | |
| d_meter=$(echo $input_distance \* 1000 | bc -l) | |
| echo $d_meter "m" | |
| d_cm=$(echo $d_meter \* 100 | bc -l) | |
| echo $d_cm "cm" | |
| d_in=$(echo $d_cm \* 0.39 | bc -l) | |
| echo $d_in "inches" | |
| d_feet=$(echo $d_in / 12 | bc -l) | |
| echo $d_feet "ft" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment