{"id":1572,"date":"2015-06-06T02:08:46","date_gmt":"2015-06-05T17:08:46","guid":{"rendered":"http:\/\/www.catracing.org\/hendrb\/?p=1572"},"modified":"2016-12-26T20:45:00","modified_gmt":"2016-12-26T11:45:00","slug":"fun-with-bash-scripts-random-quote-generator","status":"publish","type":"post","link":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/","title":{"rendered":"Fun With BASH Scripts &#8211; Random Quote Generator"},"content":{"rendered":"<p><a href=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-37\" src=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png\" alt=\"Blog - Centos\" width=\"150\" height=\"150\" srcset=\"https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png 150w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos.png 250w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/a><\/p>\n<p>One of the cool features of IMAGE BBS and C-NET was displaying fun and witty sayings during the login process (On older versions of C-Net I believe this was referred to as a Fortune Cookie.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_1575\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/IMAGE-Saying.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1575\" class=\"wp-image-1575 size-full\" src=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/IMAGE-Saying.jpg\" alt=\"Image BBS Random Saying (Screen Shot From Commodore Image BBS)\" width=\"640\" height=\"400\" srcset=\"https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/IMAGE-Saying.jpg 640w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/IMAGE-Saying-300x188.jpg 300w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/IMAGE-Saying-480x300.jpg 480w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><p id=\"caption-attachment-1575\" class=\"wp-caption-text\">Image BBS Random Saying (Screen Shot From Commodore Image BBS)<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>In some ways, especially if you login to a UNIX\/LINUX box via a terminal, it looks just like a giant BBS. I thought it would be fun to duplicate this feature on my Linux development box. It will also give me the opportunity to introduce to you login scripts or \u201cProfiles\u201d, as well as basic file manipulation.<\/p>\n<p>The last 2 BASH demonstrations were taken from Commodore 64 BASIC programs, and from an IMAGE BBS +. File, so let\u2019s switch gears here, and take our source from a CNET Amiga 3.5c module that was written by Jim Selleck of Beverly James Products. This module was included on the CNET 3.05c Demo and Productions disks, and the comments state it originated with C-Net Amiga 2.0.<\/p>\n<p>Before we begin I would like to throw out a quite plug for C-Net Amiga 3, and the brilliant work done by its author Ken Pletzer. C-Net Amiga 3.05c happened to be one of the most stable, customizable, and feature rich BBS software that I had a pleasure to run. This particular module was written in ARREX, which was an Amiga port of the REXX scripting language developed by IBM and included with Amiga DOS 2.0. There is a version of REXX that will run under Linux. So maybe in the future we could actually explore some native REXX scripts running under Linux itself.<\/p>\n<p>Lets quickly take a look at the original source, as REXX, and it\u2019s features under C-Net Amiga are pretty straight forward and lend itself to very easy porting into BASH.<\/p>\n<p>\/******************************************************\/<br \/>\n\/* Random Quotation Generator 2 for CNet AMIGA v2 *\/<br \/>\n\/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *\/<br \/>\n\/* By Jim Selleck \u00a9 1992 Beverly James Products *\/<br \/>\n\/* *\/<br \/>\n\/* Installation: *\/<br \/>\n\/* *\/<br \/>\n\/* Stick this Arexx program and the QUOTATIONS file *\/<br \/>\n\/* in your PFILES: directory. *\/<br \/>\n\/* #*\/<br \/>\n\/******************************************************\/<\/p>\n<p>options results<br \/>\nfilename = &#8220;pfiles:quotations&#8221;<\/p>\n<p>if ~exists(filename) then<\/p>\n<p>do<br \/>\ntransmit &#8221; &#8221;<br \/>\ntransmit &#8221; &#8221;<br \/>\ntransmit &#8220;The Quotations could not be found! Please inform&#8221;<br \/>\ntransmit &#8220;the Sysop !!!&#8221;<br \/>\ntransmit &#8221; &#8221;<br \/>\ntransmit &#8221; &#8221;<br \/>\nlogentry &#8220;Quote: `&#8221;||filename||&#8221;&#8216; not found!&#8221;<br \/>\nexit<br \/>\nend<\/p>\n<p>call open quote,filename,&#8221;R&#8221;<\/p>\n<p>max = readln(quote) \/* Get maximum number of entries *\/<br \/>\nnum = random(0,max-1,time(&#8216;s&#8217;))<br \/>\nctr = 0<\/p>\n<p>if num &gt; 0 then<br \/>\ndo until ctr = num*5<br \/>\nline = readln(quote)<br \/>\nctr = ctr+1<br \/>\nend<\/p>\n<p>transmit &#8221; &#8221;<br \/>\ntransmit &#8221; &#8221;<br \/>\nctr = 0<\/p>\n<p>do until ctr = 5<br \/>\nline = readln(quote)<br \/>\nif length(line) &gt; 1 then transmit center(strip(line),76)<br \/>\nctr = ctr+1<br \/>\nend<\/p>\n<p>call close quote<br \/>\nexit<\/p>\n<p>The lines in the \/* *\/ are simply comments, similar to BASH pounds #<\/p>\n<p>Filename = is simply setting the path to the quotations filename in this case \u201cPFILES:quotations\u201d<br \/>\nWe then have the script saying, if the file does not exist ~exists, then output the text asking the user to inform the SysOp (System Operator).<\/p>\n<p>\u2018logentry\u2019 is a specific CNET AREXX function that will write an entry into the systems caller log.<\/p>\n<p>The next line is&nbsp;&nbsp;opens the quotations file, and then reads the first line, which will specify the number of quotes, Which is 100. Then the result \u2018num\u2019 will be a random number between 1 and the number of MAXQUOTES.<\/p>\n<p>The file is then read from line X for 5 more lines, and is center justified for a 79 character line.&nbsp; So we have a 500 line text file, each 5 lines is a record, containing the quote and the source.<\/p>\n<p>Here is our simple BASH script called \u2018rand_quote.sh\u2019. The quotations file was read directly from CNET Amiga using the WinUAE emulator and saved to a capture file.<\/p>\n<p>Let\u2019s now take a look at our BASH script. I would recommend creating this in a dev folder in your home directory, once tested you can move it in to the proper folder.<\/p>\n<p>You must also download the quotations file, from the following link.<br \/>\n<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/quotations.txt\">http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/quotations.txt<\/a><\/span><br \/>\n<span style=\"color: #ffff00;\">1 #! \/bin\/bash<\/span><br \/>\n<span style=\"color: #ffff00;\"> 2 <\/span><br \/>\n<span style=\"color: #ffff00;\"> 3 # BASH script to display RANDOM QUOTE and center text depending on terminal width.<\/span><br \/>\n<span style=\"color: #ffff00;\"> 4 # BASH script and quotations taken from CNET Amiga 2 AREXX PFILE<\/span><br \/>\n<span style=\"color: #ffff00;\"> 5 # AMIGA Version Copyright 1992 Jim Selleck and Beverly James Products<\/span><br \/>\n<span style=\"color: #ffff00;\"> 6 #<\/span><br \/>\n<span style=\"color: #ffff00;\"> 7 # BASH Script (C)24MAY2015 by Brent Hendricks<\/span><br \/>\n<span style=\"color: #ffff00;\"> 8 # Script and accompaning BLOG article (C) 2015 Brent Hendricks<\/span><br \/>\n<span style=\"color: #ffff00;\"> 9 # Script and quotes are public domain, the accompaning BLOG may only be used with permission<\/span><br \/>\n<span style=\"color: #ffff00;\"> 10 # Contact brent.hendricks@catracing.org if you wish to republish the article.<\/span><br \/>\n<span style=\"color: #ffff00;\"> 11 # Please visit Brent&#8217;s World @ www.catracing.org\\hendrb<\/span><br \/>\n<span style=\"color: #ffff00;\"> 12 <\/span><br \/>\n<span style=\"color: #ffff00;\"> 13 ## Get Terminal Width<\/span><br \/>\n<span style=\"color: #ffff00;\"> 14 TERMWIDE=&#8221;$(tput cols)&#8221;<\/span><br \/>\n<span style=\"color: #ffff00;\"> 15 ((TERMWIDE = TERMWIDE -3))<\/span><br \/>\n<span style=\"color: #ffff00;\"> 16 <\/span><br \/>\n<span style=\"color: #ffff00;\"> 17 ## Set file path<\/span><br \/>\n<span style=\"color: #ffff00;\"> 18 QUOTATIONS=\/home\/local_hendrb01\/dev\/bash\/randquote\/quotations<\/span><br \/>\n<span style=\"color: #ffff00;\"> 19 TEMP_QUOTATION=\/home\/local_hendrb01\/dev\/bash\/randquote\/temp_quotation <\/span><br \/>\n<span style=\"color: #ffff00;\"> 20 <\/span><br \/>\n<span style=\"color: #ffff00;\"> 21 ## Get number of quotations<\/span><br \/>\n<span style=\"color: #ffff00;\"> 22 QUOTES=&#8221;$(cat $QUOTATIONS | wc -l)&#8221;<\/span><br \/>\n<span style=\"color: #ffff00;\"> 23 ((QUOTES = QUOTES \/ 5))<\/span><br \/>\n<span style=\"color: #ffff00;\"> 24 <\/span><br \/>\n<span style=\"color: #ffff00;\"> 25 ## Pick a record<\/span><br \/>\n<span style=\"color: #ffff00;\"> 26 <\/span><br \/>\n<span style=\"color: #ffff00;\"> 27 RECORD=$(($RANDOM % $QUOTES * 5))<\/span><br \/>\n<span style=\"color: #ffff00;\"> 28 <\/span><br \/>\n<span style=\"color: #ffff00;\"> 29 ## Read Quote from Quote file<\/span><br \/>\n<span style=\"color: #ffff00;\"> 30 sed -n &#8220;${RECORD},+5p&#8221; $QUOTATIONS &gt; $TEMP_QUOTATION<\/span><br \/>\n<span style=\"color: #ffff00;\"> 31 sed -e :a -e &#8220;s\/^.\\{1,${TERMWIDE}\\}$\/ &amp;\/;ta&#8221; -e &#8216;s\/\\( *\\)\\1\/\\1\/&#8217; $TEMP_QUOTATION<\/span><br \/>\n<span style=\"color: #ffff00;\"> 32 <\/span><br \/>\n<span style=\"color: #ffff00;\"> 33 ## Remove TEMP_QUOTATION scratch file<\/span><br \/>\n<span style=\"color: #ffff00;\"> 34 rm -f &#8220;${TEMP_QUOTATION}&#8221;<\/span><\/p>\n<h3><span style=\"color: #ff0000;\">NOTE: Once you download the quotation file, you will need to rename it quotations, or change the quotations path to reflect the .txt extension <span style=\"color: #ffffff;\">(WordPress does not allow the uploading of files without extensions.)<\/span><\/span><\/h3>\n<p>We should by now know what line 1 does, and why we put it there, but as a quick reminder, Line 1 tells *NIX which interpreter to use. Just in case the user is in, or defaults to a different shell. Additionally AT&amp;T used to default to the Bourne Shell, while BSD defaulted to the C shell.<\/p>\n<p>While not needed if you never use a different shell, it is good practice, and insures compatibility.<\/p>\n<p>Lines 3 \u2013 11 are my standard comments, comments in shell scripts are preceded by #s<\/p>\n<p>Lines 14 Gets the terminal width, and line 15 subtracts 3 from it. This is for the center justification routines later in the script.<\/p>\n<p>Lines 18 and 19 set our file paths.<br \/>\nLine 18 is the path of the actual quotation file.<br \/>\nLine 19 is the path of the temp file created by SED<\/p>\n<p>Lines 22 and 23 gets the number of quotations from the quotations file and puts them in the variable QUOTES. Note that our script is a bit different because&nbsp;we use the wc command to dynamically derive the number of quotes, as long as you remember that each quote uses 5 lines. This is done with the QUOTES=&#8221;$(cat $QUOTATIONS | wc -l)&#8221; command. Note the use and format here of command substitution. I am going to get nailed here by someone much smarter with BASH scripts than I am. For the wasteful use of the cat command, when technically you could have used just the wc \u2013l and the file name. If done this way, the output was would have been \u2018500 quotations\u2019. To save time with a filtering statement, I just had the file cat\u2019d, and piped through wc. The value is held in the variable QUOTES, then divided by 5. Since each 5 lines is a quote.<\/p>\n<p>Line 27 Picks a random quote, in steps of 5. Since it would not do us much good to start reading in the middle of quote now would it?<\/p>\n<p>Lines 30 and 31 are where the real magic occur, and what took me the longest to figure out. I could read various quotes all day until the sun came home, but while BASH has a command to left and right justify, it will not center justify. Again my method and someone else\u2019s methods might vary. I could very well have loaded the quotations file in nano, or word and center justified it and re saved it. However that defeats the purpose of learning, defeats the purpose of making your quotation file dynamic, as each time you added a quote you would have to remember to justify it. It might also look funny if someone had a different sized terminal window then you did when you justified it.<\/p>\n<p>Line 30 reads the 5 lines from the quotations file, and saves it in a file called temp_quotation.<br \/>\nLine 31 uses sed to center justify the text in the temp file and display it to the screen. The use of SED is outside the scope of this blog, and many good descriptions are available elsewhere on the net. If you are interested in the working of stream editor. I would start here. http:\/\/www.grymoire.com\/Unix\/Sed.html<\/p>\n<p>Line 34 simply deletes the temp file, without prompting.<\/p>\n<p>There you have it! A random quote generator for *NIX!<\/p>\n<p>If we want this to be just like a BBS, and display it when a user logs in, we now have several choices to make.<\/p>\n<p>Do we want this script to be run only when we login, or for all users?<\/p>\n<p>If you want it displayed for all users, we must first move it somewhere where they have access to execute it. For this demonstration let\u2019s move it to the \/opt volume.<\/p>\n<p>We can use the mv (MOVE) command.<\/p>\n<p>sudo mv .\/randqutoe \/opt<\/p>\n<p>I have to use sudo here, because root is the owner of the opt directory, and I do not have my local username added to the root group.<\/p>\n<p>Once it is moved, I can verify the entire contests of the randquote directory were copied.<\/p>\n<p>If I cd to \/opt\/randquote, I should have two files.<\/p>\n<p>-rw-rw-r&#8211;. 1 local_hendrb01 local_hendrb01 9893 May 24 07:30 quotations<br \/>\n-rwxrwxr-x. 1 local_hendrb01 local_hendrb01 1169 May 30 13:22 randquote.sh<\/p>\n<p>Make sure the file permissions match.<\/p>\n<p>The next decision is if you want the randquote script to run only when you login to the console, or both the console and the terminal.<\/p>\n<h3><span style=\"color: #00ffff;\">If you want it to execute when logging a console only,<\/span><\/h3>\n<h4>Edit the following file in your favorite editor.<br \/>\n\/etc\/profile<\/h4>\n<p>And the following lines.<\/p>\n<p>##Display Random Quote On Login For All Users Console Login ONLY<br \/>\n## Added by Your Name \/ DATE<br \/>\necho<br \/>\n\/opt\/randquote\/randquote.sh<br \/>\necho<\/p>\n<p>Save the file.<br \/>\nWe must now edit the following lines in our randquote program, since it is no longer residing in your standalone development directory.<\/p>\n<p>Change line 18 to read:<br \/>\nQUOTATIONS=\/opt\/randquote\/quotations<\/p>\n<p>Change line 19 to read:<br \/>\nTEMP_QUOTATION=\/opt\/temp_quotation<br \/>\nSave the file, now logoff then back on and you should now the random quote generated.<\/p>\n<h3><a href=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/console_randquote.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1574 size-full\" src=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/console_randquote.jpg\" alt=\"console_randquote\" width=\"1536\" height=\"324\" srcset=\"https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/console_randquote.jpg 1536w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/console_randquote-300x63.jpg 300w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/console_randquote-1024x216.jpg 1024w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/console_randquote-500x105.jpg 500w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><\/a><span style=\"color: #00ffff;\">If you also wish a random quote to be generated when you launch a shell from a terminal window in XWindows or from the console<\/span>.<\/h3>\n<p><span style=\"color: #ffff00;\">NOTE: If you put in both files, you will have 2 quotes generated when logging in from the console!<\/span><\/p>\n<p>We must do the following.<\/p>\n<p>Using your favorite editor, add the following lines to \/etc\/bashrc<\/p>\n<p>##Display Random Quote when opening a shell session via the terminal For All Users<br \/>\n## Added by Your Name \/ DATE<br \/>\necho<br \/>\n\/opt\/randquote\/randquote.sh<br \/>\necho<\/p>\n<p>Save the file.<\/p>\n<p>Open a terminal session.<\/p>\n<p><a href=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/terminal_randquote.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1576\" src=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/terminal_randquote.jpg\" alt=\"terminal_randquote\" width=\"742\" height=\"496\" srcset=\"https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/terminal_randquote.jpg 742w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/terminal_randquote-300x201.jpg 300w, https:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2015\/06\/terminal_randquote-449x300.jpg 449w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/a><\/p>\n<h3><span style=\"color: #00ffff;\">If you only want specific users to have the random quotes displayed.<\/span><\/h3>\n<p>edit their respective .profile and .bashrc files in their home directory \/home\/&lt;shortname&gt;\/<\/p>\n<p>For our next tutorial we are going to do three things with this script!<\/p>\n<p>1) Add it to a LINUX login profile, for both terminal and console login<br \/>\n2) Add it to a OS X login profile, for both terminal and SSH login<br \/>\n3) We are going to add something magical for our OS X users!<\/p>\n<p>So be sure to come back for next month\u2019s technical blog, as we do more with *NIX!<\/p>\n<p>Special thanks go to Ken Pletzer and Jim Selleck for the wonderful work you did in the 90s with C-Net Amiga Professional BBS. For the many hours of fun I had with your product!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the cool features of IMAGE BBS and C-NET was displaying fun and witty sayings during the login process (On older versions of C-Net I believe this was referred to as a Fortune Cookie. &nbsp; &nbsp; &nbsp; In some <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/\"><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":true,"_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-1572","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>Fun With BASH Scripts - Random Quotes<\/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\/fun-with-bash-scripts-random-quote-generator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fun With BASH Scripts - Random Quotes\" \/>\n<meta property=\"og:description\" content=\"One of the cool features of IMAGE BBS and C-NET was displaying fun and witty sayings during the login process (On older versions of C-Net I believe this was referred to as a Fortune Cookie. &nbsp; &nbsp; &nbsp; In some &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/\" \/>\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-06-05T17:08:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-12-26T11:45:00+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png\" \/>\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\/fun-with-bash-scripts-random-quote-generator\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/\"},\"author\":{\"name\":\"Brent Hendricks\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442\"},\"headline\":\"Fun With BASH Scripts &#8211; Random Quote Generator\",\"datePublished\":\"2015-06-05T17:08:46+00:00\",\"dateModified\":\"2016-12-26T11:45:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/\"},\"wordCount\":1917,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442\"},\"image\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png\",\"articleSection\":[\"Technical\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/\",\"url\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/\",\"name\":\"Fun With BASH Scripts - Random Quotes\",\"isPartOf\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png\",\"datePublished\":\"2015-06-05T17:08:46+00:00\",\"dateModified\":\"2016-12-26T11:45:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#primaryimage\",\"url\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png\",\"contentUrl\":\"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.catracing.org\/hendrb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fun With BASH Scripts &#8211; Random Quote Generator\"}]},{\"@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":"Fun With BASH Scripts - Random Quotes","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\/fun-with-bash-scripts-random-quote-generator\/","og_locale":"en_US","og_type":"article","og_title":"Fun With BASH Scripts - Random Quotes","og_description":"One of the cool features of IMAGE BBS and C-NET was displaying fun and witty sayings during the login process (On older versions of C-Net I believe this was referred to as a Fortune Cookie. &nbsp; &nbsp; &nbsp; In some &hellip; Continue reading &rarr;","og_url":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/","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-06-05T17:08:46+00:00","article_modified_time":"2016-12-26T11:45:00+00:00","og_image":[{"url":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png","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\/fun-with-bash-scripts-random-quote-generator\/#article","isPartOf":{"@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/"},"author":{"name":"Brent Hendricks","@id":"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442"},"headline":"Fun With BASH Scripts &#8211; Random Quote Generator","datePublished":"2015-06-05T17:08:46+00:00","dateModified":"2016-12-26T11:45:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/"},"wordCount":1917,"commentCount":1,"publisher":{"@id":"https:\/\/www.catracing.org\/hendrb\/#\/schema\/person\/abd5b294207e782562c7bb51e0a9e442"},"image":{"@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#primaryimage"},"thumbnailUrl":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png","articleSection":["Technical"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/","url":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/","name":"Fun With BASH Scripts - Random Quotes","isPartOf":{"@id":"https:\/\/www.catracing.org\/hendrb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#primaryimage"},"image":{"@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#primaryimage"},"thumbnailUrl":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png","datePublished":"2015-06-05T17:08:46+00:00","dateModified":"2016-12-26T11:45:00+00:00","breadcrumb":{"@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#primaryimage","url":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png","contentUrl":"http:\/\/www.catracing.org\/hendrb\/wp-content\/uploads\/2014\/05\/Blog-Centos-150x150.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.catracing.org\/hendrb\/fun-with-bash-scripts-random-quote-generator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.catracing.org\/hendrb\/"},{"@type":"ListItem","position":2,"name":"Fun With BASH Scripts &#8211; Random Quote Generator"}]},{"@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-pm","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/posts\/1572","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=1572"}],"version-history":[{"count":0,"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/posts\/1572\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/media?parent=1572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/categories?post=1572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.catracing.org\/hendrb\/wp-json\/wp\/v2\/tags?post=1572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}