Maybe bash should catch this
$ echo x > a > b > c > d
and print a warning.
Same with
$ cat < a < b < c < d
On Sun, Apr 16, 2017 at 6:42 PM, 積丹尼 Dan Jacobson wrote:
> Maybe bash should catch this
> $ echo x > a > b > c > d
> and print a warning.
> Same with
> $ cat < a < b < c < d
Why? These are perfectly valid grammatical constructs. What kind of
warning are you expecting to see and why?
OK sorry. I guess they make a lot of sense.
On Sun, Apr 16, 2017 at 7:40 PM, 積丹尼 Dan Jacobson wrote:
> OK sorry. I guess they make a lot of sense.
These constructs are valid grammatically, and have a well defined
semantic meaning. See:
dualbus@debian:~$ strace -e open bash -c ': &1|tail -n5
open("a", O_RDONLY) = 3
open
OK. (But shellcheck doesn't catch it either.)
$ { echo '#!/bin/sh'; echo 'echo x > c > c > c';}|shellcheck /dev/stdin
$ { echo '#!/bin/sh'; echo 'echo x < c < c < c';}|shellcheck /dev/stdin