Aaron Rainbolt on Nostr: Disturbing shell scripting fact for the day - both `true` and `echo ''` can exit ...
Disturbing shell scripting fact for the day - both `true` and `echo ''` can exit non-zero. All you have to do is get in some esoteric edge case that results in a SIGPIPE being triggered.
Guess what I just spent the last thirty minutes of my life trying to figure out.
#bash #sh #linux
Published at
2024-10-21 01:39:32Event JSON
{
"id": "2a8f06917675da8114a7ba4cd65eb677c59d4a10dd070cf39cfb9780baecfda2",
"pubkey": "b764dfce4744790ecaba851b29af6750c60a24d3792a14a8912039f0fb5becf1",
"created_at": 1729474772,
"kind": 1,
"tags": [
[
"t",
"bash"
],
[
"t",
"sh"
],
[
"t",
"linux"
],
[
"proxy",
"https://theres.life/users/arraybolt3/statuses/113342858698894068",
"activitypub"
]
],
"content": "Disturbing shell scripting fact for the day - both `true` and `echo ''` can exit non-zero. All you have to do is get in some esoteric edge case that results in a SIGPIPE being triggered.\n\nGuess what I just spent the last thirty minutes of my life trying to figure out.\n\n#bash #sh #linux",
"sig": "bf1cc5fe293dc2bda424894fe2ab5ce8d0e083d92d6c084ec99c839d362f279aaaa294acba73af6e143a9216b64ed6eda7f793a00779e1faf675a6b4e5d17a69"
}