Randomly select one of the directories in the PATH environment variable, and output the directory path to a file named "random.txt" in the home directory.
shuf -e $(echo ${PATH//:/\\n} | tr ' ' '\n') | head -n 1 | xargs -I % echo % -o ~/random.txt