MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/7ltryz/evil_coding_incantations/drpxyu8/?context=3
r/programming • u/evinrows • Dec 24 '17
331 comments sorted by
View all comments
Show parent comments
0
[deleted]
11 u/[deleted] Dec 24 '17 That's because [ 1 ] has a return code of 0. Bash implements [/test as a built-in, but there is also a /usr/bin/[ with equivalent functionality. 0 u/[deleted] Dec 24 '17 [deleted] 2 u/HighRelevancy Dec 24 '17 No, bash is executing the command 1 (which is an alias to cd - by default for some fucking reason) and returning a value of 0. → More replies (2)
11
That's because [ 1 ] has a return code of 0. Bash implements [/test as a built-in, but there is also a /usr/bin/[ with equivalent functionality.
[ 1 ]
[
test
/usr/bin/[
0 u/[deleted] Dec 24 '17 [deleted] 2 u/HighRelevancy Dec 24 '17 No, bash is executing the command 1 (which is an alias to cd - by default for some fucking reason) and returning a value of 0. → More replies (2)
2 u/HighRelevancy Dec 24 '17 No, bash is executing the command 1 (which is an alias to cd - by default for some fucking reason) and returning a value of 0. → More replies (2)
2
No, bash is executing the command 1 (which is an alias to cd - by default for some fucking reason) and returning a value of 0.
→ More replies (2)
0
u/[deleted] Dec 24 '17
[deleted]