Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #166809

Re: My script almost works but spams the terminal its launched from if useing dash.

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: My script almost works but spams the terminal its launched from if useing dash.
Date 2016-04-17 04:30 +0200
Message-ID <roKDf-5iP-9@gated-at.bofh.it> (permalink)
References <roBTk-72V-17@gated-at.bofh.it> <roCPn-7M4-1@gated-at.bofh.it> <roHvI-2PY-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat 16 Apr 2016 at 19:06:42 (-0400), Gene Heskett wrote:
> On Saturday 16 April 2016 14:02:16 Thomas Schmitt wrote:
> > Gene Heskett wrote:
> > > There are too many places where a conditional would be needed
> >
> > The classic way is to use only gestures which are supported by the
> > Bourne shell and to avoid certain peculiarities of some shells.
> > In ./configure scripts of source packages one can see gestures
> > like
> >
> >           if test "x${InMail}" = xgene
> >
> > which avoids to compare empty variable content.
> 
> In normal everyday operation, the variable ${InMail} will not be empty.

That may or may not be a useful observation. However, sod's law
dictates that when it *is* empty, it'll be in five years time when
you've forgotten how and why you converted your script, and you
desparately need it to work _now_.

Going back a step or two:

"This bash script has lived in ~/bin for years, but the mention of
 dash as a replacement for bash made me want to test it with dash by
 changing the bang line to #!/bin/sh, which is of course (this is
 wheezy) a softlink to /bin/dash."

Debian took a decision long ago to make dash the default shell for
*system* scripts. In that sense only, dash replaced bash, and the
replacement took a while because all the bashisms had first to be
removed from those scripts headed by #!/bin/sh. Water under the
bridge now.

Grepping /var/lib/dpkg/info/*.p* can be a quick way of finding
examples of dash's ways and means. However, you're probably wasting
your time converting your own scripts unless you need the efficiency.

And this statement:

"However, I'll go on record as opposing any motions to remove bash,
 the old man on the mountain of cli shells still gets the job done."

is an unfounded fear. The default login shell is bash, as usual.

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-16 17:30 +0200
  Re: My script almost works but spams the terminal its launched from  if useing dash. Aero Maxx <aero.maxx.d@gmail.com> - 2016-04-16 18:10 +0200
    Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-16 18:50 +0200
      Re: My script almost works but spams the terminal its launched from  if useing dash. Aero Maxx <aero.maxx.d@gmail.com> - 2016-04-16 19:20 +0200
        Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 00:50 +0200
        Re: My script almost works but spams the terminal its launched from  if useing dash. Michael Milliman <michael.e.milliman@gmail.com> - 2016-04-17 08:30 +0200
          Re: My script almost works but spams the terminal its launched from if  useing dash. Jeremy Nicoll <jn.ml.dbn.25@letterboxes.org> - 2016-04-17 13:00 +0200
            Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 13:50 +0200
              Re: My script almost works but spams the terminal its launched from if  useing dash. Jeremy Nicoll <jn.ml.dbn.25@letterboxes.org> - 2016-04-17 15:10 +0200
                Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 15:30 +0200
                Re: My script almost works but spams the terminal its launched from  if useing dash. Michael Milliman <michael.e.milliman@gmail.com> - 2016-04-17 15:40 +0200
                Re: My script almost works but spams the terminal its launched from if  useing dash. Jeremy Nicoll <jn.ml.dbn.25@letterboxes.org> - 2016-04-17 16:40 +0200
            Re: My script almost works but spams the terminal its launched from  if useing dash. Michael Milliman <michael.e.milliman@gmail.com> - 2016-04-17 15:30 +0200
          Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 13:50 +0200
        Re: My script almost works but spams the terminal its launched from  if useing dash. Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> - 2016-04-22 06:30 +0200
          Re: My script almost works but spams the terminal its launched from  if useing dash. Michael Milliman <michael.e.milliman@gmail.com> - 2016-04-22 07:00 +0200
            Re: Re: My script almost works but spams the terminal its launched  from if useing dash. Clive Standbridge <list-user@tgstandbridges.plus.com> - 2016-04-22 11:40 +0200
          Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-22 10:30 +0200
          Re: My script almost works but spams the terminal its launched from  if useing dash. David Wright <deblis@lionunicorn.co.uk> - 2016-04-22 13:10 +0200
  Re: My script almost works but spams the terminal its launched from if useing dash. Sven Joachim <svenjoac@gmx.de> - 2016-04-16 18:50 +0200
    Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-16 19:10 +0200
      Re: My script almost works but spams the terminal its launched from  if useing dash. Linux-Fan <Ma_Sys.ma@web.de> - 2016-04-16 19:30 +0200
      Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-16 20:10 +0200
        Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 01:10 +0200
          Re: My script almost works but spams the terminal its launched from  if useing dash. David Wright <deblis@lionunicorn.co.uk> - 2016-04-17 04:30 +0200
            Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 06:50 +0200
              Re: My script almost works but spams the terminal its launched from  if useing dash. David Wright <deblis@lionunicorn.co.uk> - 2016-04-18 16:00 +0200
                Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-18 20:50 +0200
          Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 14:10 +0200
          Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 14:10 +0200
            Re: My script almost works but spams the terminal its launched from if useing dash. Gene Heskett <gheskett@shentel.net> - 2016-04-17 15:20 +0200
              Re: My script almost works but spams the terminal its launched from if useing dash. "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-17 16:40 +0200

csiph-web