3 ms·
The redirect at the end of the env var seems to be "remembered" even though the syntax error aborts the function definition, then the first arg is taken as the
by scintill76 12y ago
The redirect at the end of the env var seems to be "remembered" even though the syntax error aborts the function definition, then the first arg is taken as the path to redirect to, and the following args as the command to execute. (I haven't dug into the actual parser, this is just my intuitive understanding.) It does seem to be about like $1 > $0, so not generally exploitable.
Here's an example using it to read files instead of write: https://news.ycombinator.com/item?id=8365205 https://news.ycombinator.com/item?id=8365205 But still, not as universal of an exploit as the original.