From 030e1e47f0a8334582dcae182414e05a6dd05aa0 Mon Sep 17 00:00:00 2001 From: koalaman Date: Wed, 14 May 2014 12:45:41 -0700 Subject: [PATCH] Created SC1040 (markdown) --- SC1040.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 SC1040.md diff --git a/SC1040.md b/SC1040.md new file mode 100644 index 0000000..1f84b70 --- /dev/null +++ b/SC1040.md @@ -0,0 +1,33 @@ +## When using <<-, you can only indent with tabs. + +### Problematic code: + +Any code using `<<-` that is indented with spaces. `cat -T script` shows + + cat <<- foo + Hello world + foo + +### Correct code: + +Code using `<<-` must be indented with tabs. `cat -T script` shows + + ^Icat <<- foo + ^I^IHello world + ^Ifoo + +Or simply don't indent the end token: + + cat <<- foo + Hello World + foo + +### Rationale: + +`<<-`, by design, only strips tabs. Not spaces. + +Your editor may be automatically replacing tabs with spaces, either when you type them or when you save the file or both. If you're unable to make it stop, just don't indent the end token. + +### Contraindications + +None. But note that copy-pasting code to [shellcheck.net](http://www.shellcheck.net) may also turn correct tabs into spaces on some OS. \ No newline at end of file