diff options
| author | EuAndreh <eu@euandre.org> | 2026-09-12 00:15:09 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2026-09-12 00:15:09 -0300 |
| commit | 1749d83c37095f2c1b71ee6fc71b42fe223a3b29 (patch) | |
| tree | 27e039c6eee9e72013d6f20857239b09143cf357 /src/content | |
| parent | Drop gettext from meta.txt (diff) | |
| download | euandre.org-1749d83c37095f2c1b71ee6fc71b42fe223a3b29.tar.gz euandre.org-1749d83c37095f2c1b71ee6fc71b42fe223a3b29.tar.xz | |
Diffstat (limited to '')
| -rw-r--r-- | src/content/en/til/2020/12/15/shellcheck-repo.adoc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/content/en/til/2020/12/15/shellcheck-repo.adoc b/src/content/en/til/2020/12/15/shellcheck-repo.adoc index 387e793..e33b318 100644 --- a/src/content/en/til/2020/12/15/shellcheck-repo.adoc +++ b/src/content/en/til/2020/12/15/shellcheck-repo.adoc @@ -95,9 +95,9 @@ scripts/with-container.sh ---- It looks to be almost there, but the `TODOs.org` entry shows a flaw in it: grep -is looking for a +'^#!/'+ pattern on any part of the file. In my case, +is looking for a `'^#!/'` pattern on any part of the file. In my case, `TODOs.org` had a snippet in the middle of the file where a line started with -+#!/bin/sh+. +`#!/bin/sh`. So what we actually want is to match the *first* line against the pattern. We could loop through each file, get the first line with `head -n 1` and grep @@ -141,7 +141,7 @@ git ls-files -z | \ ---- This is where I've stopped, but I imagine a likely improvement: match against -only +#!/bin/sh+ and +#!/usr/bin/env bash+ shebangs (the ones I use most), to +only `#!/bin/sh` and `#!/usr/bin/env bash` shebangs (the ones I use most), to avoid running ShellCheck on Perl files, or other shebangs. Also when reviewing the text of this article, I found that `{ nextfile }` is a |
