2

Dear all,

Refresh time is 86,400 seconds, but it actually doesnt do it in 86400 seconds... which is why I'm going to change it to refresh in 0 seconds as long as i can get it to randomly switch through quotes in my code shell.

I have a folder named quotes in which I have about a hundred .txt files each one individually having one quote.

Down below is my code:

!/bin/bash

QUOTESDIR=~/Documents/GeekToolStuff/quotes IFS=' ' quotefiles=(ls -1 "${QUOTES_DIR}") count=${#quotefiles[@]} cat ${QUOTESDIR}/${quotefiles[$((RANDOM%$count))]}

Comments

User Avatar
Aaryan 423 days ago
code down below

| |

v v
User Avatar
Aaryan 423 days ago
nope that doesnt work.. ok HERE IS THE CODE

#!/bin/bash

QUOTES_DIR=~/Documents/GeekToolStuff/quotes

IFS='

'

quotefiles=(`ls -1 "${QUOTES_DIR}"`)

count=${#quotefiles[@]}

cat ${QUOTES_DIR}/${quotefiles[$((RANDOM%$count))]}

Log in to comment or register here.