Over a million developers have joined DZone.

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"
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}