Commit 550ac8a
committed
Fix order of -- and - in cat command
Somewhat unintuitively, the "-" is considered to be a file operand
and not an option, even though it treated to signify standard input
rather than a file named "-". On some systems including macOS,
options to cat cannot follow paths. On those systems, writing "-"
before "--" causes "--" to be treated as a filename, causing the
script to break on macOS.
This changes the order, which lets the cat command work on all
systems, though (as before) if the subsequent argument were a
literal "-" then that would not have the desired effect. In this
case that is okay, since we actually know that the other argument,
the value of the source_file variable, is not exactly "-".
(We even know that it does not begin "-". But keeping the "--"
before it makes clearer to human readers that this argument is a
path and never an option.)1 parent deeac5e commit 550ac8a
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
0 commit comments