bash question

Thomas M. Albright talbright at tarogue.net
Mon Sep 23 11:37:40 EDT 2002


I don't have any of my bash scripting books handy so I figured I'd ask
here: I have a script that checks due dates. I use `date +%j` to convert
both today and the date due into day of year. (eg - today is 266) I then
subtract today from the due date.

If the due date is greater than today, it outputs the message "Due in x
days." If the due date is less than today I get a message saying "You
are -x days past due." How can I convert the negative number into a
positive one in bash?

Thanks in advance!

-- 
TARogue (Linux user number 234357)
 An honest man can feel no pleasure in the exercise of power over his
 fellow citizens. -Thomas Jefferson, third US president, architect and
 author (1743-1826)




More information about the gnhlug-discuss mailing list