Skip to content

Instantly share code, notes, and snippets.

@abrarShariar
Created August 27, 2016 17:19
Show Gist options
  • Select an option

  • Save abrarShariar/b5e1c2543fd5cc7eaafda18bc1cef5c3 to your computer and use it in GitHub Desktop.

Select an option

Save abrarShariar/b5e1c2543fd5cc7eaafda18bc1cef5c3 to your computer and use it in GitHub Desktop.
lab test OS
#!/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