▲ 762 ▼ looks good to me (lemm.ee) submitted 2 years ago by Irelephant@lemm.ee to c/programmer_humor@programming.dev 47 comments fedilink hide all child comments
[–] Classy@sh.itjust.works 18 points 2 years ago (1 child) I, too, place 2> /dev/null after every line permalink fedilink source hideshow 2 child comments replies: [–] bhamlin@lemmy.world 6 points 2 years ago (1 child) Yes, but 2>&1 > /dev/null is the real hero. permalink fedilink source parent hideshow 2 child comments replies: [–] far_university190@feddit.org 2 points 2 years ago (1 child) No, > /dev/null 2>&1 is. If try your example but with file instead null, stderr content not in file. Because x>y not redirect x to y, but duplicate y and set x to y-duplicate. See bash manpage REDIRECTION (your example in that section for what not work). As i understand, your example set 2 to what 1 is, then set 1 to null. Now 2 not null, but what 1 before. permalink fedilink source parent hideshow 2 child comments replies: [–] bhamlin@lemmy.world 1 point 2 years ago (1 child) So, the joke is that it should hide all output. permalink fedilink source parent hideshow 2 child comments replies: [–] far_university190@feddit.org 1 point 2 years ago* Yes it do, your example do too. But if test thing and replace null with file, suddenly stderr missing. Happen to me, 5h debug session. Hope to help prevent that for other people. permalink fedilink source parent
[–] bhamlin@lemmy.world 6 points 2 years ago (1 child) Yes, but 2>&1 > /dev/null is the real hero. permalink fedilink source parent hideshow 2 child comments replies: [–] far_university190@feddit.org 2 points 2 years ago (1 child) No, > /dev/null 2>&1 is. If try your example but with file instead null, stderr content not in file. Because x>y not redirect x to y, but duplicate y and set x to y-duplicate. See bash manpage REDIRECTION (your example in that section for what not work). As i understand, your example set 2 to what 1 is, then set 1 to null. Now 2 not null, but what 1 before. permalink fedilink source parent hideshow 2 child comments replies: [–] bhamlin@lemmy.world 1 point 2 years ago (1 child) So, the joke is that it should hide all output. permalink fedilink source parent hideshow 2 child comments replies: [–] far_university190@feddit.org 1 point 2 years ago* Yes it do, your example do too. But if test thing and replace null with file, suddenly stderr missing. Happen to me, 5h debug session. Hope to help prevent that for other people. permalink fedilink source parent
[–] far_university190@feddit.org 2 points 2 years ago (1 child) No, > /dev/null 2>&1 is. If try your example but with file instead null, stderr content not in file. Because x>y not redirect x to y, but duplicate y and set x to y-duplicate. See bash manpage REDIRECTION (your example in that section for what not work). As i understand, your example set 2 to what 1 is, then set 1 to null. Now 2 not null, but what 1 before. permalink fedilink source parent hideshow 2 child comments replies: [–] bhamlin@lemmy.world 1 point 2 years ago (1 child) So, the joke is that it should hide all output. permalink fedilink source parent hideshow 2 child comments replies: [–] far_university190@feddit.org 1 point 2 years ago* Yes it do, your example do too. But if test thing and replace null with file, suddenly stderr missing. Happen to me, 5h debug session. Hope to help prevent that for other people. permalink fedilink source parent
[–] bhamlin@lemmy.world 1 point 2 years ago (1 child) So, the joke is that it should hide all output. permalink fedilink source parent hideshow 2 child comments replies: [–] far_university190@feddit.org 1 point 2 years ago* Yes it do, your example do too. But if test thing and replace null with file, suddenly stderr missing. Happen to me, 5h debug session. Hope to help prevent that for other people. permalink fedilink source parent
[–] far_university190@feddit.org 1 point 2 years ago* Yes it do, your example do too. But if test thing and replace null with file, suddenly stderr missing. Happen to me, 5h debug session. Hope to help prevent that for other people. permalink fedilink source parent