On Tue, Dec 28, 2010 at 11:43:13AM +0100, Dejan Muhamedagic wrote:
> On Mon, Dec 27, 2010 at 04:56:53PM +0100, alexander.kra...@basf.com wrote:
> >  > On Thu, Dec 23, 2010 at 10:17:03PM +0100, alexander.kra...@basf.com 
> > wrote:
> > > 
> > > > -  sidadm="`echo $SID | tr [:upper:] [:lower:]`adm"
> > > > +  sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
> > > 
> > > AFAIK, [:upper:] corresponds to (in English) A-Z, i.e. it
> > > shouldn't be expanded by the shell. As opposed to [[:upper:]] or
> > > [A-Z]. Are you sure that this needs fixing?
> > 
> > Yes, I'm sure:
> > 
> > a...@ncc1701d:~> echo "SMALL" | tr [:upper:] [:lower:]
> > small
> > a...@ncc1701d:~> touch u
> > a...@ncc1701d:~> echo "SMALL" | tr [:upper:] [:lower:]
> > tr: misaligned [:upper:] and/or [:lower:] construct
> > a...@ncc1701d:~> echo "SMALL" | tr '[:upper:]' '[:lower:]'
> > small
> 
> OK. It was unexpected to me that shell and tr differ in
> expansion. It turns out that bash treats [:upper:] as a set.

Even if it would not, if a matching files were present,
it would still expand to those files before being passed as arguments to tr.

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to