Send a request to the website http://www.randomtext.me/download/txt/lorem/20-40, replace all spaces with new lines, take the first number of lines randomly chosen between 1 and 20, remove all new lines and echo the result.
curl http://www.randomtext.me/download/txt/lorem/20-40 | tr ' ' '\n' | head -n $(shuf -i 1-20 -n 1) | tr -d '\n' | xargs echo