Skip to content

Instantly share code, notes, and snippets.

@jacekmigacz
Created April 7, 2021 11:14
Show Gist options
  • Save jacekmigacz/b9f08c668ea07c65ac7d377c31677f59 to your computer and use it in GitHub Desktop.
Save jacekmigacz/b9f08c668ea07c65ac7d377c31677f59 to your computer and use it in GitHub Desktop.
rh-hw1
#!/bin/bash
sample_output() {
echo 1 2
echo 3 4
echo 5 6
}
find_max() {
local x=0
local y=0
while read x1 y1; do
[ $x1 -gt $x ] && x=$x1
[ $y1 -gt $y ] && y=$y1
done < <(sample_output)
echo $x $y
}
find_max
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment