Bug 488916 - 0anacron unary operator expected
Summary: 0anacron unary operator expected
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: anacron
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-06 07:42 UTC by Allen Kistler
Modified: 2009-03-06 08:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-06 08:27:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Allen Kistler 2009-03-06 07:42:03 UTC
Description of problem:
There's a syntax error in /etc/cron.hourly/0anacron that causes the script to only send an email with the subject error in it.

Version-Release number of selected component (if applicable):
anacron-2.3-71.fc11

How reproducible:
Always

Steps to Reproduce:
1. make sure anacron and cronie are installed
2. read mail at the top of every hour
  
Actual results:
/etc/cron.hourly/0anacron: line 3: [: 20090306: unary operator expected

(The date varies, of course.)

Expected results:
No email.  The script should run without generating a syntax error message.

Additional info:
This bug was reported as Bug 486156 (closed as a duplicate of Bug 252254) and resolved as part of Bug 252254 as "Fixed in anacron-2.3-70," but it isn't resolved as of anacron-2.3-71.fc11.

The suggested patch from Bug 252254 was:

--- 0anacron.orig       2009-02-10 03:00:15.000000000 -0700
+++ 0anacron    2009-02-16 08:53:55.000000000 -0700
@@ -1,6 +1,6 @@
 #!/bin/bash
 day=`cat /var/spool/anacron/cron.daily`
-if [ `date +%Y%m%d` = $day ]; then
+if [ `date +%Y%m%d` = "$day" ]; then
     exit 0;
 fi

Comment 1 Marcela Mašláňová 2009-03-06 08:20:59 UTC
Ok, this somehow didn't go to cvs. This should be fixed in anacron-2.3-72. (I check the file after build for be 100% sure).

Comment 2 Marcela Mašláňová 2009-03-06 08:27:49 UTC
Please feel free to reopen it, if there will be any other troubles.


Note You need to log in before you can comment on or make changes to this bug.