diff options
4 files changed, 76 insertions, 0 deletions
diff --git a/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md b/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md index 91ab22e..2b434b4 100644 --- a/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md +++ b/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md @@ -150,5 +150,21 @@ Also when reviewing the text of this article, I found that `{ nextfile }` is a GNU Awk extension. It would be an improvement if `assert-shellcheck.sh` relied on the POSIX subset of Awk for working correctly. +## *Update* + +After publishing, I could remove `{ nextfile }` and even make the script +simpler: + +```shell +#!/usr/sh +set -eu + +git ls-files -z | \ + xargs -0 awk 'FNR==1 && /^#!\// { print FILENAME }' | \ + xargs shellcheck +``` + +Now both the shell and Awk usage are POSIX compatible. + [awk-20min]: https://ferd.ca/awk-in-20-minutes.html [shellcheck]: https://www.shellcheck.net/ diff --git a/locale/eo/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po b/locale/eo/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po index 8c55368..41cfc66 100644 --- a/locale/eo/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po +++ b/locale/eo/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po @@ -183,6 +183,26 @@ msgstr "" msgid "ref: awk-snippet-shellcheck-all-scripts-in-a-repository" msgstr "" +msgid "*Update*" +msgstr "" + +msgid "" +"After publishing, I could remove `{ nextfile }` and even make the script " +"simpler:" +msgstr "" + +msgid "" +"#!/usr/sh\n" +"set -eu\n" +"\n" +"git ls-files -z | \\\n" +" xargs -0 awk 'FNR==1 && /^#!\\// { print FILENAME }' | \\\n" +" xargs shellcheck\n" +msgstr "" + +msgid "Now both the shell and Awk usage are POSIX compatible." +msgstr "" + #~ msgid "" #~ "title: 'Awk snippet: ShellCheck all scripts in a repository'\n" #~ "date: 2020-12-15\n" diff --git a/locale/fr/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po b/locale/fr/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po index 8c55368..41cfc66 100644 --- a/locale/fr/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po +++ b/locale/fr/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po @@ -183,6 +183,26 @@ msgstr "" msgid "ref: awk-snippet-shellcheck-all-scripts-in-a-repository" msgstr "" +msgid "*Update*" +msgstr "" + +msgid "" +"After publishing, I could remove `{ nextfile }` and even make the script " +"simpler:" +msgstr "" + +msgid "" +"#!/usr/sh\n" +"set -eu\n" +"\n" +"git ls-files -z | \\\n" +" xargs -0 awk 'FNR==1 && /^#!\\// { print FILENAME }' | \\\n" +" xargs shellcheck\n" +msgstr "" + +msgid "Now both the shell and Awk usage are POSIX compatible." +msgstr "" + #~ msgid "" #~ "title: 'Awk snippet: ShellCheck all scripts in a repository'\n" #~ "date: 2020-12-15\n" diff --git a/locale/pt/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po b/locale/pt/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po index 8c55368..41cfc66 100644 --- a/locale/pt/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po +++ b/locale/pt/LC_MESSAGES/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.po @@ -183,6 +183,26 @@ msgstr "" msgid "ref: awk-snippet-shellcheck-all-scripts-in-a-repository" msgstr "" +msgid "*Update*" +msgstr "" + +msgid "" +"After publishing, I could remove `{ nextfile }` and even make the script " +"simpler:" +msgstr "" + +msgid "" +"#!/usr/sh\n" +"set -eu\n" +"\n" +"git ls-files -z | \\\n" +" xargs -0 awk 'FNR==1 && /^#!\\// { print FILENAME }' | \\\n" +" xargs shellcheck\n" +msgstr "" + +msgid "Now both the shell and Awk usage are POSIX compatible." +msgstr "" + #~ msgid "" #~ "title: 'Awk snippet: ShellCheck all scripts in a repository'\n" #~ "date: 2020-12-15\n" |