DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Bash Title Random Quote Routine
#
#this is a script in my .bash_profile that gets a random
#quote .txt file and assigns it to the terminal title.
#
quote_path="/Users/glynch/Documents/quotes/*"
files=($quote_path)
N=${#files[@]}
((N=RANDOM%N))
randomfile=${files[$N]}
quote=""
while read line; do quote="$quote $line"; done < $randomfile
echo -n -e "\033]0;$quote\007"





