{"id":995,"date":"2015-01-17T22:42:27","date_gmt":"2015-01-17T13:42:27","guid":{"rendered":"http:\/\/www.catracing.org\/hendrb\/?p=995"},"modified":"2020-05-25T19:10:40","modified_gmt":"2020-05-25T10:10:40","slug":"bash-scripting-mystic-8-ball-oracle","status":"publish","type":"post","link":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/","title":{"rendered":"BASH Scripting &#8211; Mystic 8-Ball Oracle"},"content":{"rendered":"<p><a href=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-996\" src=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg\" alt=\"Oracle IMAGE\" width=\"300\" height=\"199\" srcset=\"https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg 300w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-453x300.jpg 453w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE.jpg 646w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>My first article on BASH scripting, where we took a simple number guessing program from the Commodore 64 Users Guide and turned it into a BASH script was so popular <span style=\"color: #00ffff;\"><a style=\"color: #00ffff;\" href=\"http:\/\/www.catracing.org\/hendrb\/bash-script-guess-number\/\">http:\/\/www.catracing.org\/hendrb\/bash-script-guess-number\/<\/a> <\/span>. We had to do a followup. So to up the ante, I thought I could also reference the blog on BBSing <a href=\"http:\/\/www.catracing.org\/hendrb\/carrier-lost-world-bbs\/\"><span style=\"color: #00ffff;\">http:\/\/www.catracing.org\/hendrb\/carrier-lost-world-bbs<\/span>\/<\/a>, and take an IMAGE BBS +.file and attempt to convert it to a BASH script. After all, what is a terminal session anyways, but a big BBS?<\/p>\n<p>For those of you who have not had any exposure to Image BBS or its predecessor C-Net, a Plus file (+.filename, or filename), are basic program modules that are loaded to perform function on the BBS. Each subsystem of the BBS, IE Sub Boards, Upload\/Download areas, was a separate program or +. File. Other SysOps could even write their own +. Files, to create more functionality, or write online games.<br \/>\nC-Net, and Image BBS both used a slightly modified BASIC to perform specific tasks, such as outputting text to the screen and modem simultaneously, interpret MCI, etc.<\/p>\n<p>C-Net\u2019s text output command was a$=\u201dText (K)\u201d:syso<\/p>\n<p>While Image BBS used the &amp; character.<\/p>\n<p>&amp; \u201cText (K)\u201d (This took up less memory, as it uses fewer characters in the program listing.<\/p>\n<p>Both programs used a Shifted F5 to perform a carriage return, this looked like an inversed K, which is represented here by (K).<\/p>\n<p>Most likely, you\u2019re not here for a BBS history lesson, and want to get down to the programming! So what program did I choose to convert into a BASH script? There was one program on the original Image BBS 1.0 disk that I always had allot of fun with, The Mystical 8 Ball Oracle!<\/p>\n<p>I also thought it would be a great example of some BASH scripting concepts, such as the Do While loop, case statement, and getting to use some ANSI color! One thing about Image BBS, was that it was very colorful! You too can make your BASH scripts stand out by learning ANSI escape sequences.<\/p>\n<p>If you use the echo command you can add COLOR, bold, blinking, and underlined text to your output.<\/p>\n<p>To encode text simply use the \u2013e option of the echo command followed by \\e[&lt;ANSI CODE&gt;m<\/p>\n<p>For instance let\u2019s say we want to make our text output bold blue. The ANSI code for bold is 1, and the code for blue text is 44. The line in our BASH script would look like this.<br \/>\n<span style=\"color: #ff0000;\">echo \u2013e \u201c\\e[1;44mThis is a bold blue line of text\\e[0m\u201d<\/span><\/p>\n<p>Go ahead and try this at a BASH shell prompt and you should see bold blue text. Here is a good troubleshooting hint. Anything that you can do in a BASH script you can do at the command line. So if something is not working in your script you can break them down line by line at a prompt to find out exactly what is not working.<\/p>\n<p>So let\u2019s break the command above down. We are executing the echo command with the \u2013e (Text encoding option), all ANSI codes entered must be proceeded by the \\e and the terminals escape character, in this case the left bracket [. There are two ANSI escape codes in this example separated by the ; 01 specifies bold text, and 44 is the color blue. All ANSI escape sequences must end with the lower case m. The next part of the echo command our actual text, and the \\e[0m simply resets the ANSI output to default. So we are not put back at a terminal prompt with a strange color.<\/p>\n<p>Let\u2019s take a look at some common ANSI control codes, that would be useful for your BASH scripts.<\/p>\n<p><a href=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/ANSI-Codes.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-998\" src=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/ANSI-Codes.jpg\" alt=\"ANSI Codes\" width=\"1127\" height=\"600\" srcset=\"https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/ANSI-Codes.jpg 1127w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/ANSI-Codes-300x160.jpg 300w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/ANSI-Codes-1024x545.jpg 1024w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/ANSI-Codes-500x266.jpg 500w\" sizes=\"auto, (max-width: 1127px) 100vw, 1127px\" \/><\/a><\/p>\n<p>So Now that you have an idea of what we will be working with in the program, let&#8217;s take a look at our BASH script.<\/p>\n<p><span style=\"color: #ffff00;\"> 1 #!\/bin\/bash<br \/>\n2 # \/* The Great 8-Ball Oracle *\/<br \/>\n3 # \/* Commodore 64 IMAGE BBS +. File By The Misty Mountain BBS *\/<br \/>\n4 # \/* Included On the IMAGE BBS V1.0 Disk Side 2 *\/<br \/>\n5 # \/* Converted to BASH Script By Brent P Hendricks *\/<br \/>\n6 # \/* Demonstrating Random Numbers, Nested Loops, Case Statement *\/<br \/>\n7 # \/* Check Out Brent&#8217;s World, for the acompanied article. *\/<br \/>\n8 # \/* Released to public domain, blog article text (C) 2015 *\/<br \/>\n9 # \/* Brent&#8217;s World Blog. www.catracing.org\/hendrb *\/<br \/>\n10<br \/>\n11 PLAY=1<br \/>\n12<br \/>\n13<br \/>\n14 clear<br \/>\n15 echo -e &#8220;\\n\\n \\e[1;42mThe Misty Mountain Presents\\e[0m&#8221;<br \/>\n16 echo -e &#8221; \\e[37mWisom Of The Mystic Masters&#8221;<br \/>\n17 echo -e &#8221; \\e[1;35mThe Mystical 8-Ball Oracle\\e[0m&#8221;<br \/>\n18 echo -e &#8220;\\n\\n\\n\\e[37mOriginal Commodore 64 program appeared on side 2 of the IMABE BBS System Disk&#8221;<br \/>\n19 echo -e &#8220;Converted to BASH Script by Brent Hendricks. To Demonstrate Nested Loop (Do Until),&#8221;<br \/>\n20 echo -e &#8220;RANDOM Numbers, CASE statement, and ANSI escape codes.&#8221;<br \/>\n21 echo -e &#8220;\\nThis script has been released into the public domain. However the accompanying blog&#8221;<br \/>\n22 echo -e &#8220;article remains the property of Brent Hendricks, and Brent&#8217;s World.&#8221;<br \/>\n23 echo -e &#8220;\\nBe sure to check out Brent&#8217;s World @ www.catracing.org\/hendrb&#8221;<br \/>\n24 echo -e &#8220;\\n&#8221;<br \/>\n25 # echo $PLAY<br \/>\n26 while [ &#8220;$PLAY&#8221; -eq &#8220;1&#8221; ]<br \/>\n27 do<br \/>\n28<br \/>\n29 echo -en &#8220;\\n\\nMake Thy Request To The Mystical 8-Ball\\nBe Thou Certain, Thy Request May Be Answered Yea or Nay.\\n: \\e[1;97m&#8221;<br \/>\n30 read AN<br \/>\n31 echo -en &#8220;\\n\\e[36mCommencing GURU Meditation.&#8221;<br \/>\n32 COUNT=1<br \/>\n33 until [ $COUNT -eq 40 ]<br \/>\n34 do<br \/>\n35 echo -n &#8220;.&#8221;<br \/>\n36 ((COUNT=$COUNT+1))<br \/>\n37 done<br \/>\n38<br \/>\n39 echo -e &#8220;\\n\\e[0mYou asketh &#8211; $AN.&#8221;<br \/>\n40 DICE=$((RANDOM % 17 + 1))<br \/>\n41 echo -en &#8220;The Answer Is &#8211; &#8221;<br \/>\n42 case &#8220;$DICE&#8221; in<br \/>\n43 1)<br \/>\n44 echo -e &#8220;Yes&#8230;\\n&#8221;<br \/>\n45 ;;<br \/>\n46 2)<br \/>\n47 echo -e &#8220;No&#8230;\\n&#8221;<br \/>\n48 ;;<br \/>\n49 3)<br \/>\n50 echo -e &#8220;Maybe..\\n&#8221;<br \/>\n51 ;;<br \/>\n52 4)<br \/>\n53 echo -e &#8220;Probably Yes..\\n&#8221;<br \/>\n54 ;;<br \/>\n55 5)<br \/>\n56 echo -e &#8220;Probably No..\\n&#8221;<br \/>\n57 ;;<br \/>\n58 6)<br \/>\n59 echo -e &#8220;Undecided..\\n&#8221;<br \/>\n60 ;;<br \/>\n61 7)<br \/>\n62 echo -e &#8220;Of Course..\\n&#8221;<br \/>\n63 ;;<br \/>\n64 8)<br \/>\n65 echo -e &#8220;The Answer Seems Foggy..\\n&#8221;<br \/>\n66 ;;<br \/>\n67 9)<br \/>\n68 echo -e &#8220;Positively\\n&#8221;<br \/>\n69 ;;<br \/>\n70 10)<br \/>\n71 echo -e &#8220;Not A Chance..\\n&#8221;<br \/>\n72 ;;<br \/>\n73 11)<br \/>\n74 echo -e &#8220;The Answer Must Reamin Hidden For Now..\\n&#8221;<br \/>\n75 ;;<br \/>\n76 12)<br \/>\n77 echo -e &#8220;That Is A Silly Question..\\n&#8221;<br \/>\n78 ;;<br \/>\n79<br \/>\n80 13)<br \/>\n81 echo -e &#8220;Yep..\\n&#8221;<br \/>\n82 ;;<br \/>\n83 14)<br \/>\n84 echo -e &#8220;Look For The Answer Within Yourself..\\n&#8221;<br \/>\n85 ;;<br \/>\n86 15)<br \/>\n87 echo -e &#8220;Very Possible..\\n&#8221;<br \/>\n88 ;;<br \/>\n89<br \/>\n90 16)<br \/>\n91 echo -e &#8220;Unlikely..\\n&#8221;<br \/>\n92 ;;<br \/>\n93 17)<br \/>\n94 echo -e &#8220;Nope..\\n&#8221;<br \/>\n95 ;;<br \/>\n96 esac<br \/>\n97<br \/>\n98 echo -en &#8220;Do You have Another Query? y\/n : &#8221;<br \/>\n99 read AN<br \/>\n100 if [ $AN = &#8220;n&#8221; ]<br \/>\n101 then<br \/>\n102 echo -e &#8220;\\n\\n\\e[31mThanks For Using. \\n\\e[33mThe Great 8-Ball Oracle!&#8221;<br \/>\n103 echo -e &#8220;\\e[44Please read the associated blog article @ www.catracing.org\/hendrb\\e[0m\\n&#8221;<br \/>\n104 PLAY=0<br \/>\n105 fi<br \/>\n106 done<br \/>\n107 exit 0<\/span><\/p>\n<p><span style=\"color: #ffffff;\">One of the hardest parts I found going from Commodore BASIC to BASH scripting is unlearning the use of line numbers.&nbsp; instead of thinking line by line, I have to think in terms of blocks of code.&nbsp; or specific functions.&nbsp; Let&#8217;s take a look at what each block in our Magic 8 Ball program actually does.<\/span><\/p>\n<p>Line 1, is not really REQUIRED, if you use the BASH shell by default.&nbsp; For portability it is considered best practice to specify for your operating system what shell to use.&nbsp; So Line 1 simply calls the BASH interpreter.&nbsp; the #! is called the she-bang or shebang..<\/p>\n<p>Lines 2-9 are simple comment statements, equivelant to BASICs REM statement.&nbsp; Any line in your code that is preceded by the pound or #, is not acted upon by the interpreter.&nbsp; This is also used in .conf files, to toggle configuration functions on and off.&nbsp; This is called POUNDING OUT.&nbsp; So if you hear someone say, just POUND IT OUT.&nbsp; It means to put a # sign in front of a line in a script of .conf file.<\/p>\n<p>Line 11 sets the variable PLAY to equal 1.&nbsp; It is good practice to setup static variables at the beginning of the script, before they are used in the script.&nbsp; This is used in our Do while Loop, but more on that later.<\/p>\n<p>line 14 clears the screen<\/p>\n<p>Lines 15 &#8211; 24&nbsp; is our scripts title screen. Made up of the echo command, using the -n and or the -e option.<\/p>\n<p style=\"padding-left: 30px;\">-n tells the echo command that you do not want a NEWLINE (CR\/LF) sent after the closing quotes.<br \/>\n-e tells the echo command to interpret escape characters, such as \\n (NEW LINE), or \\e (ANSI Escape codes)<\/p>\n<p style=\"padding-left: 30px;\">Line 25 (Which is pounded out), was used for troubleshooting.&nbsp; It is not executed.<\/p>\n<p style=\"padding-left: 30px;\">Line 26 begins the main portion of our program, which will continue until the PLAY variable is set to 0.&nbsp; Since BASH does not support any type of a GOTO function.&nbsp; We have to set the program as one big loop in order to execute the routine again, if the player so chooses.&nbsp; [ sets up a test routine, which is testing that the PLAY variable is equal -eq to 1\/ NOTE: the spaces are there for SYNTAX, not to make it easier to read.<\/p>\n<p style=\"padding-left: 30px;\">Line 29 establishes our prompt for input, and line 30 reads the keyboard for input (Similar to BASICs INPUT command.), the result is returned in variable AN.<\/p>\n<p style=\"padding-left: 30px;\">Line 32-37 is a simple do UNTIL loop, similar to a BASIC FOR\/NEXT loop.&nbsp; It outputs 40 &#8220;.&#8221;s to the screen<\/p>\n<p style=\"padding-left: 30px;\">The loop will be active until the variable COUNT is equal to &#8220;40&#8221;, until it does it will echo &#8220;.&#8221; to screen, and the -n option tells echo, not to add a NEWLINE to the end of it&#8217;s output.&nbsp; Lilne 35 increments count, by 1.<\/p>\n<p style=\"padding-left: 30px;\">Line 39 simply echo&#8217;s again what the user input, and is stored in variable AN<\/p>\n<p style=\"padding-left: 30px;\">Line 40 generates a random number between 1 and 17.<\/p>\n<p style=\"padding-left: 30px;\">Our output is generated between lines 42 &#8211; 96 using a CASE statement to mimic BASIC 2.0s DATA statement.&nbsp; The Basic program simply read the data variable x amount of times until it came to the correct response.<\/p>\n<p style=\"padding-left: 30px;\">IE: 200 DATA &#8220;Yes, No, Maybe, &#8230; , &#8230; , &#8230;&#8221;, if DICE =3, then the response would have read Maybe.<\/p>\n<p style=\"padding-left: 30px;\">Line 42 opens the case statement, and each line after that specifies if DICE = x) then perform the tabbed function.&nbsp; You do not have to tab the next lines, but it does make it easier to read.<\/p>\n<p style=\"padding-left: 30px;\">IE 1)<\/p>\n<p style=\"padding-left: 90px;\">echo -e &#8220;Yes&#8230;\\n&#8221;<\/p>\n<p style=\"padding-left: 30px;\">Each case function must end with two semi colons. And finally the entire case function is executed with the esac command as seen in line 96.<\/p>\n<p style=\"padding-left: 30px;\">Line 98 prompts the user if they would like to ask the Mystic 8 ball another question, and the answer is returned in variable AN<\/p>\n<p style=\"padding-left: 30px;\">If the user answers no, the exit message is displayed, as seen in lines 102-103, and the PLAY variable is set to 0.&nbsp; Which if you remember would exit out DO WHILE loop, and return the user to the main prompt.<\/p>\n<p style=\"padding-left: 30px;\">If the user answers Y, then PLAY stays set to 1, and the loop begins at the beginning.<\/p>\n<p style=\"padding-left: 30px;\">If you choose to type the above script in, using the text editor of your choice, remember you must make the script executable.<\/p>\n<p style=\"padding-left: 30px;\">Save the script as 8ball.sh<br \/>\nAt a shell prompt enter chmod 775 8ball.sh<\/p>\n<p style=\"padding-left: 30px;\">To execute the script, simple enter .\/8ball.sh<br \/>\nThis should be your output.<\/p>\n<p style=\"padding-left: 30px;\"><a href=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-BASH.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-999\" src=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-BASH.jpg\" alt=\"Oracle BASH\" width=\"811\" height=\"523\" srcset=\"https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-BASH.jpg 811w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-BASH-300x193.jpg 300w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-BASH-465x300.jpg 465w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/a><\/p>\n<h3 style=\"padding-left: 30px;\">Thank you for visiting Brent&#8217;s World.&nbsp; We hope you enjoyed another BASH scripting article, we hope that you take the time to experiment with out script.&nbsp; Please feel free to share any comments, and enhancements.<\/h3>\n<p>SysOps running Image BBS&#8217;s are welcome to copy this blogs text, as long as it is copied in it&#8217;s entirety and credit is given to Brent Hendricks, and the URL to Brent&#8217;s World is displayed in the text.&nbsp; The original Commodore BASIC program was included on disk 2 of Image BBS v1.0.&nbsp; Image BBS is Copyright New Image Software, and has been released to the public domain.&nbsp; This BASH script is also public domain, however the blog text is Copyright 2015 Brent P Hendricks.<\/p>\n<p style=\"padding-left: 30px;\">&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My first article on BASH scripting, where we took a simple number guessing program from the Commodore 64 Users Guide and turned it into a BASH script was so popular http:\/\/www.catracing.org\/hendrb\/bash-script-guess-number\/ . We had to do a followup. So to <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[],"class_list":["post-995","post","type-post","status-publish","format-standard","hentry","category-technical"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>BASH Scripting - Mystic 8-Ball Oracle - Brent&#039;s World<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"BASH Scripting - Mystic 8-Ball Oracle - Brent&#039;s World\" \/>\n<meta property=\"og:description\" content=\"My first article on BASH scripting, where we took a simple number guessing program from the Commodore 64 Users Guide and turned it into a BASH script was so popular http:\/\/www.catracing.org\/hendrb\/bash-script-guess-number\/ . We had to do a followup. So to &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/\" \/>\n<meta property=\"og:site_name\" content=\"Brent&#039;s World\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Brents-World-912767498915017\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/Brents-World-912767498915017\" \/>\n<meta property=\"article:published_time\" content=\"2015-01-17T13:42:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-25T10:10:40+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg\" \/>\n<meta name=\"author\" content=\"Brent Hendricks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brent Hendricks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/\"},\"author\":{\"name\":\"Brent Hendricks\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442\"},\"headline\":\"BASH Scripting &#8211; Mystic 8-Ball Oracle\",\"datePublished\":\"2015-01-17T13:42:27+00:00\",\"dateModified\":\"2020-05-25T10:10:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/\"},\"wordCount\":1921,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442\"},\"image\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg\",\"articleSection\":[\"Technical\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/\",\"url\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/\",\"name\":\"BASH Scripting - Mystic 8-Ball Oracle - Brent&#039;s World\",\"isPartOf\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg\",\"datePublished\":\"2015-01-17T13:42:27+00:00\",\"dateModified\":\"2020-05-25T10:10:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#primaryimage\",\"url\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg\",\"contentUrl\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.catracing.org\/hendrb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BASH Scripting &#8211; Mystic 8-Ball Oracle\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#website\",\"url\":\"https:\/\/www.catracing.org\/hendrb\/\",\"name\":\"Brent&#039;s World\",\"description\":\"Your weekly dose of the life of Brent!\",\"publisher\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.catracing.org\/hendrb\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442\",\"name\":\"Brent Hendricks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2019\/05\/Brent-Sitting-portrait-2.jpg\",\"url\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2019\/05\/Brent-Sitting-portrait-2.jpg\",\"contentUrl\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2019\/05\/Brent-Sitting-portrait-2.jpg\",\"width\":4480,\"height\":6720,\"caption\":\"Brent Hendricks\"},\"logo\":{\"@id\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2019\/05\/Brent-Sitting-portrait-2.jpg\"},\"sameAs\":[\"http:\/\/www.catracing.org\",\"https:\/\/www.facebook.com\/Brents-World-912767498915017\"],\"url\":\"https:\/\/www.catracing.org\/hendrb\/author\/hendrb01\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BASH Scripting - Mystic 8-Ball Oracle - Brent&#039;s World","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/","og_locale":"en_US","og_type":"article","og_title":"BASH Scripting - Mystic 8-Ball Oracle - Brent&#039;s World","og_description":"My first article on BASH scripting, where we took a simple number guessing program from the Commodore 64 Users Guide and turned it into a BASH script was so popular http:\/\/www.catracing.org\/hendrb\/bash-script-guess-number\/ . We had to do a followup. So to &hellip; Continue reading &rarr;","og_url":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/","og_site_name":"Brent&#039;s World","article_publisher":"https:\/\/www.facebook.com\/Brents-World-912767498915017","article_author":"https:\/\/www.facebook.com\/Brents-World-912767498915017","article_published_time":"2015-01-17T13:42:27+00:00","article_modified_time":"2020-05-25T10:10:40+00:00","og_image":[{"url":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg","type":"","width":"","height":""}],"author":"Brent Hendricks","twitter_misc":{"Written by":"Brent Hendricks","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#article","isPartOf":{"@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/"},"author":{"name":"Brent Hendricks","@id":"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442"},"headline":"BASH Scripting &#8211; Mystic 8-Ball Oracle","datePublished":"2015-01-17T13:42:27+00:00","dateModified":"2020-05-25T10:10:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/"},"wordCount":1921,"commentCount":1,"publisher":{"@id":"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442"},"image":{"@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#primaryimage"},"thumbnailUrl":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg","articleSection":["Technical"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/","url":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/","name":"BASH Scripting - Mystic 8-Ball Oracle - Brent&#039;s World","isPartOf":{"@id":"https:\/\/www.catracing.org\/hendrb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#primaryimage"},"image":{"@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#primaryimage"},"thumbnailUrl":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg","datePublished":"2015-01-17T13:42:27+00:00","dateModified":"2020-05-25T10:10:40+00:00","breadcrumb":{"@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#primaryimage","url":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg","contentUrl":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/01\/Oracle-IMAGE-300x199.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.catracing.org\/hendrb\/bash-scripting-mystic-8-ball-oracle\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.catracing.org\/hendrb\/"},{"@type":"ListItem","position":2,"name":"BASH Scripting &#8211; Mystic 8-Ball Oracle"}]},{"@type":"WebSite","@id":"https:\/\/www.catracing.org\/hendrb\/#website","url":"https:\/\/www.catracing.org\/hendrb\/","name":"Brent&#039;s World","description":"Your weekly dose of the life of Brent!","publisher":{"@id":"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.catracing.org\/hendrb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442","name":"Brent Hendricks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2019\/05\/Brent-Sitting-portrait-2.jpg","url":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2019\/05\/Brent-Sitting-portrait-2.jpg","contentUrl":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2019\/05\/Brent-Sitting-portrait-2.jpg","width":4480,"height":6720,"caption":"Brent Hendricks"},"logo":{"@id":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2019\/05\/Brent-Sitting-portrait-2.jpg"},"sameAs":["http:\/\/www.catracing.org","https:\/\/www.facebook.com\/Brents-World-912767498915017"],"url":"https:\/\/www.catracing.org\/hendrb\/author\/hendrb01\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p43ojH-g3","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/posts\/995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/comments?post=995"}],"version-history":[{"count":0,"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/posts\/995\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/media?parent=995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/categories?post=995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/tags?post=995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}