Bash Script Return Value From Function Python Questions On While Loop