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

Re: [[/]] in shell conditionals (was: lvm on raid)



On Mon, Oct 25, 2004 at 07:36:05PM +0200, martin f krafft wrote:
> also sprach Andrew Pollock <apollock@debian.org> [2004.10.25.0020 +0200]:
> > -       # Loop until the correct amount of active devices has been selected
> > -       while [ "${SELECTED}" -ne "${DEV_COUNT}" ]; do
> > +       # Loop until at least one device has been selected
> > +       until [ "${SELECTED}" -gt "0" -a "${SELECTED}" -le "${DEV_COUNT}" ];
> 
> I wish people would start using [[/]], which are a lot better for
> scripting with variables:
> 
> > +       until [ "${SELECTED}" -gt "0" -a "${SELECTED}" -le "${DEV_COUNT}" ];
> 
> until [[ $SELECTED -gt 0 ]] && [[ $SELECTED -le $DEV_COUNT ]];

You're on debian-boot at the moment. [[ ... ]] is a bashism, not
supported by busybox, and therefore useless in d-i.

Cheers,

-- 
Colin Watson                                       [cjwatson@debian.org]



Reply to: