{"id":3870,"date":"2025-04-01T17:52:50","date_gmt":"2025-04-01T22:52:50","guid":{"rendered":"https:\/\/osric.com\/chris\/accidental-developer\/?p=3870"},"modified":"2025-04-01T17:52:50","modified_gmt":"2025-04-01T22:52:50","slug":"bash-alias-magic-eight-ball","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2025\/04\/bash-alias-magic-eight-ball\/","title":{"rendered":"Bash alias Magic Eight Ball"},"content":{"rendered":"<p>I&#8217;m perhaps overly-fond of the <a href=\"https:\/\/osric.com\/8ball\/\">Magic Eight Ball<\/a> (or Magic 8-Ball, if you prefer).<\/p>\n<p>It is perhaps surprising, then, that I have never created this Bash alias before:<\/p>\n<pre><code>alias 8ball='shuf -n1 -e \"As I See It Yes\" \"Ask Again Later\" \"Better Not Tell You Now\" \"Cannot Predict Now\" \"Concentrate And Ask Again\" \"Don'\"'\"'t Count On It\" \"It Is Certain\" \"It Is Decidedly So\" \"Most Likely\" \"My Reply Is No\" \"My Sources Say No\" \"Outlook Good\" \"Outlook Not So Good\" \"Reply Hazy Try Again\" \"Signs Point To Yes\" \"Very Doubtful\" \"Without A Doubt\" \"Yes\" \"Yes Definitely\" \"You May Rely On It\"'<\/code><\/pre>\n<p><code>\"Don'\"'\"'t Count On It\"<\/code> was the trickiest part, fortunately StackOverflow helped me with <a href=\"https:\/\/stackoverflow.com\/questions\/1250079\/how-to-escape-single-quotes-within-single-quoted-strings\">How to escape single quotes within single quoted strings?<\/a><\/p>\n<p>Harmless fun:<\/p>\n<pre><code>$ 8ball\r\nAsk Again Later\r\n$ 8ball\r\nMy Reply Is No\r\n$ 8ball\r\nVery Doubtful<\/code><\/pre>\n<p>Almost as good as running <code>yes yes<\/code> or <code>yes no<\/code>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recreating the Magic Eight Ball using the shuf command. Just what you needed to help answer the tough questions and when &#8220;yes&#8221; or &#8220;yes no&#8221; won&#8217;t do.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3870","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/3870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=3870"}],"version-history":[{"count":4,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/3870\/revisions"}],"predecessor-version":[{"id":3875,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/3870\/revisions\/3875"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=3870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=3870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=3870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}