On Mon, Apr 05, 2021 at 11:36:42AM -0400, Mark Michelson wrote:
> On 4/5/21 11:18 AM, Ben Pfaff wrote:
> > > > > > -    OVSDIR=$srcdir/ovs
> > > > > > +    OVSDIR=$(cd $srcdir/ovs; pwd)
> > 
> > This transformation less safe than it looks at first.  Since = doesn't
> > do word splitting,
> >      OVSDIR=$srcdir/ovs
> > doesn't need quotes on the right.  The "cd" command (and all other
> > commands) does do word splitting, so it needs "" to have a comparable
> > level of safety:
> >      OVSDIR=$(cd "$srcdir/ovs"; pwd)
> > 
> 
> Thanks for the note, Ben. I suppose this is the reason why the shortcut
> advice from most shell experts is to always quote everything :)

I never set out to be a shell expert, but repeated exposure to Autoconf
and Autotest has inflicted knowledge on me.  It's an occupational
hazard.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to