Once upon a time, Stephen Harris <lists at spuddy.org> 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 at cmadams.net>
On Sun, Apr 19, 2015 at 09:00:06PM -0500, Chris Adams wrote:> Once upon a time, Stephen Harris <lists at spuddy.org> said:> > 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.It's a matter of "consistency". The script began #!/bin/bash and so a direct shell invocation should _also_ use the same command. -- rgds Stephen
> > It's a matter of "consistency". The script began #!/bin/bash and so a > direct shell invocation should _also_ use the same command.Good point. I'll try to keep that in mind. Thank you, Tim On Sun, Apr 19, 2015 at 10:04 PM, Stephen Harris <lists at spuddy.org> wrote:> On Sun, Apr 19, 2015 at 09:00:06PM -0500, Chris Adams wrote: > > Once upon a time, Stephen Harris <lists at spuddy.org> said: > > > > 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. > > It's a matter of "consistency". The script began #!/bin/bash and so a > direct shell invocation should _also_ use the same command. > > -- > > rgds > Stephen > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B