nixCraft 🐧 on Nostr: If you need to redirect output and errors to /dev/null while using bash/sh shell ...
Published at
2023-06-14 22:22:23Event JSON
{
"id": "fecc98b91e535d3513c8c8136930048f0bfc69ea9330fbc88130bad6406345ab",
"pubkey": "cc3790930722bfa73e28f9a2aa0832706884305cb80687e20927c7960db99185",
"created_at": 1686781343,
"kind": 1,
"tags": [
[
"t",
"linux"
],
[
"t",
"unix"
],
[
"mostr",
"https://mastodon.social/users/nixCraft/statuses/110544902138173648"
]
],
"content": "If you need to redirect output and errors to /dev/null while using bash/sh shell scripting, you can do so by combining stderr with stdout and then redirecting the combined output to /dev/null device. This will effectively redirect any error messages to /dev/null in #Linux \u0026 #Unix. See https://www.cyberciti.biz/faq/how-to-redirect-output-and-errors-to-devnull/\n\nhttps://files.mastodon.social/media_attachments/files/110/544/898/943/290/360/original/005311e626157bcd.png",
"sig": "f99e35a65738184df594d461501e86dda59135bd861383612911af842fd6998cf25ef094105c69b958e754353919e4c86d37fac569d1c2e51b9e5bd551cddcfb"
}