Bug 252254 - /etc/cron.daily/0anacron: line 14: [: !=: unary operator expected when first run
/etc/cron.daily/0anacron: line 14: [: !=: unary operator expected when first run
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: anacron (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Marcela Mašláňová
Fedora Extras Quality Assurance
: Reopened
: 486156 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-14 18:32 EDT by Orion Poplawski
Modified: 2009-02-19 09:06 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-19 09:06:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Orion Poplawski 2007-08-14 18:32:18 EDT
Fix:

--- 0anacron.orig       2007-08-13 02:48:52.000000000 -0600
+++ 0anacron    2007-08-14 16:30:27.000000000 -0600
@@ -11,6 +11,6 @@
 test -x /usr/sbin/anacron || exit 0
 AUX1=`cat /var/spool/anacron/cron.daily`
 AUX2=`date +%Y%m%d`
-if [ $AUX1 != $AUX2 ]; then
+if [ "$AUX1" != $AUX2 ]; then
     anacron -u cron.daily
 fi
Comment 1 Marcela Mašláňová 2007-08-15 07:34:54 EDT
Thanks for report
Comment 2 Orion Poplawski 2009-02-16 10:54:47 EST
Back again, this time with /etc/cron.hourly/0anacron:

--- 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 3 Marcela Mašláňová 2009-02-19 02:18:34 EST
*** Bug 486156 has been marked as a duplicate of this bug. ***
Comment 4 Marcela Mašláňová 2009-02-19 09:06:45 EST
Fixed in anacron-2.3-70

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