bash question
Steven W. Orr
steveo at syslang.net
Mon Sep 23 11:57:13 EDT 2002
On Mon, 23 Sep 2002, Thomas M. Albright wrote:
=>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?
daysPastDue=$((daysPastDue * -1))
--
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question? steveo at syslang.net
More information about the gnhlug-discuss
mailing list