Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- out='out.txt'
- # truncate
- : >${out}
- x1=0
- y1=0
- x2=0
- y2=0
- while read -r x y; do
- if (( $(echo "${y1}<${y2}" | bc -l) &&
- $(echo "${y2}>${y}" | bc -l) )) ; then
- echo "${x2} ${y2}" >>${out}
- fi
- x1=${x2}
- y1=${y2}
- x2=${x}
- y2=${y}
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement