From 42f7d60b3cbbcc0bf3670fe9d7b6ec9b8e5cc9cd Mon Sep 17 00:00:00 2001 From: Oliver Gerlich Date: Thu, 3 Aug 2017 11:16:07 +0200 Subject: [PATCH] add note regarding Tar and ./* --- SC2035.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SC2035.md b/SC2035.md index 2708d4f..5a12509 100644 --- a/SC2035.md +++ b/SC2035.md @@ -21,4 +21,6 @@ Using `./*` will instead cause the glob to be expanded into `./-f`, which no pro Similarly, `--` by convention indicates the end of options, and nothing after it will be treated like flags (except for some programs possibly still special casing `-` as e.g. stdin). +Note that changing `*` to `./*` in GNU Tar parameters will add `./` prefix to path names in the created archive. This may cause subtle problems (eg. to search for a specific file in archive, the `./` prefix must be specified as well). So using `-- *` is a safer fix for GNU Tar commands. + For more information, see "[Filenames and Pathnames in Shell: How to do it Correctly](http://www.dwheeler.com/essays/filenames-in-shell.html)".