Skip to content
  • Torsten Bögershausen's avatar
    test: Add check-non-portable-shell.pl · c7ce70ac
    Torsten Bögershausen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Add the perl script "check-non-portable-shell.pl" to detect
    non-portable shell syntax.
    
    "echo -n" is an example of a shell command working on Linux, but not
    on Mac OS X.
    
    These shell commands are checked and reported as error:
    
     - "echo -n" (printf should be used)
     - "sed -i" (GNUism; use a temp file instead)
     - "declare" (bashism, often used with arrays)
     - "which" (unreliable exit status and output; use type instead)
     - "test a == b" (bashism for "test a = b")
    
    "make test-lint-shell-syntax" can be used to run only the check.
    
    Helped-By: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarTorsten Bögershausen <tboegi@web.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    c7ce70ac