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

Bug#48247: [PATCH] latest ash has broken 'echo' command



Hi,

On Tue, 26 Oct 1999, Eric Weigel wrote:

> >From Debian Policy Manual, version 3.0.1.1, 1999-08-16:
> 
> 4.4 Scripts
> 
>  ...
> 
>  The standard shell interpreter `/bin/sh' may be a symbolic link to any
>  POSIX compatible shell. Thus, shell scripts specifying `/bin/sh' as
>  interpreter may only use POSIX features. 
                            ^^^^^^^^^^^^^^
Policy has unclear wording here.  It should either mention:
                "system features mandated by POSIX"
or
                "system features allowed by POSIX"

>                                           If a script requires
>  non-POSIX features from the shell interpreter, the appropriate shell
   ^^^^^^^^^^^^^^^^^^
The same here:  
  "system features disallowed by POSIX"
or
  "system features not mandated by POSIX"

>  has to be specified in the first line of the script (e.g.,
>  `#!/bin/bash') and the package has to depend on the package providing
>  the shell (unless the shell package is marked `Essential', e.g., in
>  the case of bash).
> 
>  Restrict your script to POSIX features when possible so that it may
                           ^^^^^^^^^^^^^^
The same here:  
                 "system features mandated by POSIX"
or
                 "system features allowed by POSIX"

>  use /bin/sh as its interpreter. If your script works with ash, it's
>  probably POSIX compliant, but if you are in doubt, use /bin/bash.

This is unnecessarily vague too.  Ash is not the criterium here, POSIX
is.  

Also, if in doubt, don't resort to bash immediately, check POSIX first.
Generally it is better to remove bashisms from #!/bin/sh scripts if you
can, than to shoot a flea with the #!/bin/bash cannon.
 
> Now, I haven't read Posix, but it's pretty clear the intent of Debian
> Policy is that /bin/sh should support echo -n, because otherwise all of
> the Policy examples are wrong, as is /etc/init.d/skeleton (it uses echo
> -n), and who knows how many other scripts on the system will break.

Well, maybe all the examples are just wrong..

> I punched in a command to search my system for /bin/sh scripts which
> use echo -n, and what package they come from:
 
At a glance, I estimate more than 2/3 of these to be Debian native
scripts! (and you did not even include /var/lib/dpkg/info in the search.)

Maybe it would not be so unreasonable after all for Debian to become more
strict in the adaptation of POSIX definitions.

Cheers,


Joost



Reply to: