Some workaround with % char

This commit is contained in:
Yann Esposito (Yogsototh) 2011-12-13 11:20:34 +01:00
parent eba99ae8af
commit f9cf2b40e1

View file

@ -173,13 +173,13 @@ function initLatestTasksFromLogFile() {
else
latestlogfile="$logfile"
fi
local cmd="latestTasks=( $( tail -n 5 $latestlogfile | awk '{printf "\""; gsub(/"/,"\\\""); for (i=6;i<=NF;i++) printf $i" "; print "\""}' ) )"
local cmd="latestTasks=( $( tail -n 5 $latestlogfile | awk '{printf "\""; gsub(/"/,"\\\""); gsub(/%/,"°/o"); for (i=6;i<=NF;i++) printf $i" "; print "\""}' ) )"
eval $cmd
}
function initTodoTasksFromFile() {
[[ ! -r $POMODORO_TODO_FILE ]] && return
local cmd="todoTasks=( $(< $POMODORO_TODO_FILE | egrep -v '%(wait|done)' | awk '{printf "\""; gsub(/"/,"\\\""); printf $0; print "\""; }') )"
local cmd="todoTasks=( $(< $POMODORO_TODO_FILE | egrep -v '%(wait|done)' | awk '{printf "\""; gsub(/"/,"\\\""); gsub(/%/,"°/o"); printf $0; print "\""; }') )"
eval $cmd
}