Bug 113254 - error during exim startup: /etc/init.d/exim: line 37: [: too many arguments
error during exim startup: /etc/init.d/exim: line 37: [: too many arguments
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: exim (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-10 21:15 EST by Ian Kluft
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-01-13 07:52:16 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 Ian Kluft 2004-01-10 21:15:09 EST
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 07:52:16 EST
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.