Why would anyone ever invoke something like this and expect maybe to somehow steal those pipe characters? It's almost meaningless and displays just enough know how that the author should know how a shell works.
Have you never run something like "sudo echo 0 > /proc/sys/..." and only realized your mistake after running it? Ever?
Once
The parent is more similar to doing `sudo find . | grep -- "*-foo.bar" | xargs rm` which I can definitely say I've never done because it's absurd. The consequences of redirecting to a file are usually nil, unlike running rm on the output of a pipeline without at least using -n on the destructive util...
Is the "right solution" to use `tee`? I saw that once, and it seemed like we should be able to do better -- as if, had `tee` not been in the standard we wouldn't have any way to do it...
Alternatively: sudo sh -c 'echo 0 > /sys/foo'
I use tee, but you can always do the ugly sudo sh -c "..." thing.
You can spawn a shell as root but this is hardly any more elegant.