Created
April 7, 2021 11:14
-
-
Save jacekmigacz/b9f08c668ea07c65ac7d377c31677f59 to your computer and use it in GitHub Desktop.
rh-hw1
This file contains 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 | |
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