Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- max_x=
- max_y=
- while IFS= read -r line; do
- if [[ -z ${line} ]]; then
- printf '%s %s\n\n' ${max_x} ${max_y}
- max_x=
- max_y=
- continue
- fi
- read -r x y <<<${line}
- if [[ -z ${max_y} ]]; then
- max_x=${x}
- max_y=${y}
- continue
- fi
- if (( $(bc -l <<<"${y}>${max_y}") )); then
- max_x=${x}
- max_y=${y}
- fi
- done
- if [[ ! -z ${max_y} ]]; then
- printf '%s %s\n' ${max_x} ${max_y}
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement