Bug 113254 - error during exim startup: /etc/init.d/exim: line 37: [: too many arguments
Summary: error during exim startup: /etc/init.d/exim: line 37: [: too many arguments
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: exim
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-11 02:15 UTC by Ian Kluft
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-01-13 12:52:16 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ian Kluft 2004-01-11 02:15:09 UTC
Description of problem:
During startup of exim, the following error message is displayed:
   /etc/init.d/exim: line 37: [: too many arguments

Version-Release number of selected component (if applicable):
   exim-4.30-3

How reproducible:
   this happens every time exim starts

Steps to Reproduce:
1. boot system or run "/sbin/service exim start"
  
Actual results:


Expected results:


Additional info:
A one-liner diff fixes the problem for me.

*** /etc/init.d/exim.orig	2004-01-10 17:49:00.000000000 -0800
--- /etc/init.d/exim	2004-01-10 18:08:33.000000000 -0800
***************
*** 34,40 ****
  	# owned by exim - if owned by someone else we fix it up
  	if [ -f /var/log/exim/main.log ]
  	then
! 	    if [ "exim" != `ls -l /var/log/exim/main.log |cut -b 17-20` ]
  	    then
  		chown -R exim.exim /var/log/exim /var/spool/exim
  	    fi
--- 34,40 ----
  	# owned by exim - if owned by someone else we fix it up
  	if [ -f /var/log/exim/main.log ]
  	then
! 	    if [ "exim" != "$(ls -l /var/log/exim/main.log |cut -b 15-18)" ]
  	    then
  		chown -R exim.exim /var/log/exim /var/spool/exim
  	    fi

Note: I made two changes on the line:
1. I fixed the character range "cut -b 17-20" to "cut -b 15-18" so
that it correctly captures the group name "exim"
2. I changed the back-ticks (`) to a double-quoted (") bash command
substitution ( $() ) so that it won't display this error if a space
occurs within the string results from 'cut'.  A back-tick would still
have worked but I used the equivalent $( ) for readability.

Comment 1 Thomas Woerner 2004-01-13 12:52:16 UTC
Fixed in rawhide in version exim-4.30-4 or newer.


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