Difference between revisions of "Dash as /bin/sh"

From ArchWiki
Jump to: navigation, search
(add instructions for identifying bashisms)
 
m (Common places to check: pwd may not be /)
Line 18: Line 18:
  
 
*Installed scripts with a {{codeline|#!/bin/sh}} shebang:
 
*Installed scripts with a {{codeline|#!/bin/sh}} shebang:
  $ find {,usr}/bin -type f \
+
  $ find {,/usr}/bin -type f \
 
     -exec grep -l -- '^#!/bin/sh' {} \; \
 
     -exec grep -l -- '^#!/bin/sh' {} \; \
 
     -exec checkbashisms -f -p {} +
 
     -exec checkbashisms -f -p {} +

Revision as of 05:24, 21 May 2010

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Dash as /bin/sh#)

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Dash as /bin/sh#)

This article is for those who want to help dash become the new Template:Filename.

From http://article.gmane.org/gmane.linux.arch.devel/11418:

Identifying bashisms

Install Template:Package AUR with an AUR helper.

Common places to check

$ find {,/usr}/bin -type f \
    -exec grep -l -- '^#!/bin/sh' {} \; \
    -exec checkbashisms -f -p {} +
  • Package install scripts:
$ find /var/lib/pacman/local -mindepth 2 -type f -name install \
    -exec checkbashisms -f -p {} + 2>&1 |\
    grep -v -e '^you may get strange results' \
            -e 'does not appear to have a #! interpreter line;$'
  • Initscripts and daemons:
$ find \
    /etc/rc.{conf,d,local{,.shutdown},multi,shutdown,single,sysinit} -type -f \
    -exec checkbashisms -f -p {} + 2>&1 |\
    grep -v -e '^you may get strange results' \
            -e 'does not appear to have a #! interpreter line;$'

Initscript status