[Top][All Lists]

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

Re: [Groff] [PATCH] Use bash for several contrib scripts

From: Ralph Corderoy
Subject: Re: [Groff] [PATCH] Use bash for several contrib scripts
Date: Fri, 03 Jan 2014 11:16:24 +0000

Hi Mike,

> Please define what a non-standard extension shell is.

Something that isn't in POSIX's sh.

> My point is that  #!/bin/sh  is the name of a shell command that is
> not documented.  In fact it does not exist anymore.

There are many shells that aim to provide all of POSIX's sh's behaviour.
The Heirloom Bourne Shell is one,  bash has a --posix and also
changes behaviour when invoked as `sh'.

Write to the POSIX standard, `#!' to /bin/sh, and the script will run
because all sane systems arrange for a suitable shell to run them.  That
the shell used, e.g. dash, can do more does not mean that `#!
/bin/dash' should be used when the script has no dash-dependencies as it
won't then run on a system without dash.  If dash doesn't implement a
bit of POSIX sh then that's a problem for dash and the distro that uses
it for sh;  either it gets fixed or the distro works around it, e.g. a
Debian patch to groff.

> How is someone attempting to understand a  #!/bin/sh  script to know
> what the writer intended if there is no documented way to interpret
> the syntax? is a
good jumping-off point.

> All my shells  start with  #!/bin/bash  or  #!/bin/ksh  (depending on
> how long ago I wrote them -- some are decades old).  That way whoever
> reads them knows what standard I was writing to.

My *bash* scripts also start with `#! /bin/bash'.

> I'm suggesting that all the groff scripts should point to the shell
> the writer was using when they were written.
> The shell is very unlikely to have been  /bin/sh .

I should not force dash onto others when I've written to the POSIX
/bin/sh subset.

Cheers, Ralph.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]