Quick one-liner to read in Redshift’s current transition period value and assign it to a variable. (Redshift adjusts the color temperature of your screen when it gets dark.)
redshift -p 2>&1 | grep -i 'Period:' | sed -e 's@.*: \(.*\)@\1@g'
Or assign to a variable:
R=`redshift -p 2>&1 | grep -i 'Period:' | sed -e 's@.*: \(.*\)@\1@g'` echo $R