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


Groups > linux.debian.user > #166783

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

From Linux-Fan <Ma_Sys.ma@web.de>
Newsgroups linux.debian.user
Subject Re: My script almost works but spams the terminal its launched from if useing dash.
Date 2016-04-16 19:30 +0200
Message-ID <roCcG-7aM-11@gated-at.bofh.it> (permalink)
References <roAky-5Ir-13@gated-at.bofh.it> <roBzY-6BB-13@gated-at.bofh.it> <roBTk-72V-17@gated-at.bofh.it>
Organization Ma_Sys.ma

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

[Sat, 16 Apr 2016 13:07:38 -0400] Gene Heskett <gheskett@shentel.net>
wrote:
> On Saturday 16 April 2016 12:44:55 Sven Joachim wrote:
> >
> > https://wiki.ubuntu.com/DashAsBinSh has some information how to make
> > scripts portable.  The checkbashisms command in the devscripts
> > package can help you detect common non-portable constructions in
> > your scripts.
> >
> > Cheers,
> >        Sven
> 
> A bookmarked now, much better explanatory link, thank you Sven.

In addition, I recommend consulting the standard whenever doubt arises:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html

... because there is a lot of outdated information on what is POSIX and
what is not. Fortunately, The Ubuntu Wiki link given above seems to be
OK.

> I think for my stuff, I should export the value of /bin/sh, write a 
> wrapper script to determine what /bin/sh is, and run the correct
> script to get the identical wanted functionality based on the value
> of the export.  There are too many places where a conditional would
> be needed so it would use command A or command B, and thats going to
> slow it down much more than just re-writing it into 2 scripts and
> running the correct one w/o all that gingerbread & bloat.

[...]

As far as I understand, just about all scripts which work under dash
also work under bash without changes. If your script is compatible
with dash, it does not need to check if it is running under bash,
because that will ``just work''. This means: If you do the work to port
the scripts to dash, you will likely not have to maintain a separate
version for bash.

HTH
Linux-Fan

-- 
http://masysma.lima-city.de/

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