Re: bash script fails conditional test

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



Once upon a time, Stephen Harris <lists@xxxxxxxxxx> said:
> On Sun, Apr 19, 2015 at 09:40:29PM -0400, Tim Dunphy wrote:
> > Good tip! But I ran the script with sh +x . I guess that running it with sh
> 
> You should use "bash -x"  ("bash" and not "sh" because sh may not be bash
> everywhere; eg Ubuntu; "-x" and not "+x" because "-x" means "turn on debug"
> but "+x" means "turn _off_ debug")

Unless you have specific bashisms (which I don't think the original did,
and you should mostly avoid in scripts), sh -x will be fine.

-- 
Chris Adams <linux@xxxxxxxxxxx>
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux