[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#66912: PROPOSAL] init script configuration variables



On Wed, Nov 01, 2000 at 09:14:05AM -0800, Joey Hess wrote:
> Julian Gilbey wrote:
> > I (very belatedly) second this proposal.
> 
> Thanks. I think I have enough seconds now, don't really remember.
> 
> > There's one small change I would make though; see below.
> 
> > > +	      if [ -e /etc/default/bind ]; then
> > 
> > I would change the test to [ -f /etc/default/bind ].
> 
> Why? -e ensures the file exists. If the admin wants to make it a symlink
> for some reason, that is their perogative, and using -f would make it be
> ignored then.

Wrong: -f dereferences symlinks and says whether the final destination
is a normal file.  That's what you want:

$ cd /tmp
$ touch test1
$ ln -s test1 test2
$ [ -f test2 ] && echo yes
yes

   Julian

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
        Debian GNU/Linux Developer,  see http://www.debian.org/~jdg
  Donate free food to the world's hungry: see http://www.thehungersite.com/



Reply to: