{"id":3034,"date":"2017-08-17T16:15:07","date_gmt":"2017-08-17T13:15:07","guid":{"rendered":"https:\/\/www.systemcodegeeks.com\/?p=3034"},"modified":"2017-08-17T11:11:30","modified_gmt":"2017-08-17T08:11:30","slug":"lets-talk-shell-scripting","status":"publish","type":"post","link":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/","title":{"rendered":"Let&#8217;s Talk About Shell Scripting"},"content":{"rendered":"<p>Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the majority of tasks for a system. Many of the commands that need to be executed to complete a task can be grouped together in a script to help avoid repetition when typing the commands. Furthermore, there\u2019s a good amount of programming capability in shell scripting that allows you to write simple to complex programs.<\/p>\n<p>I\u2019ll be covering some basics in Bash scripting, as well as some more advanced techniques you can take advantage of. I\u2019ll also be covering a bit of <a href=\"https:\/\/fishshell.com\/\">fish shell<\/a> and why you may want to consider using it as a better tool for your command-line experience.<\/p>\n<h2>Bash Scripts<\/h2>\n<p>Bash scripts are primarily written as a text file of commands that can be executed. They can end in the <code>.sh<\/code> extension or no extension at all. They can be executed with the Bash command preceding it \u2014 <code>bash<br \/>\nmyscript.sh<\/code> \u2014 or by having the file mode set as executable and placing the path to Bash\u2019s executable at the beginning as such:<\/p>\n<pre class=\"brush:php\">#!\/bin\/bash<\/pre>\n<p>Then you can execute that script by giving the path and file name <code>.\/myscript.sh<\/code>.<\/p>\n<p>In Bash, comments are created with the pound symbol. For the sake of this post, I will be writing <code># Output:<\/code> inline in cases where it will be more helpful.<\/p>\n<p>Setting values in a script is fairly simple.<\/p>\n<pre class=\"brush:php\">value=\"Hello World!\"\r\n\r\necho value      # Output: value\r\necho $value     # Output: Hello World!\r\necho ${value}   # Output: Hello World!\r\necho \"value\"    # Output: value\r\necho \"$value\"   # Output: Hello World!\r\necho \"${value}\" # Output: Hello World!<\/pre>\n<p>As you can see above, even though the variable value was passed, it wasn\u2019t interpreted as a variable unless we preceded it with the dollar sign. Also notice that there are no spaces in <code>value=\"Hello World!\"<\/code>. This is very important in Bash as many things won\u2019t work if the spaces aren\u2019t as they need to be.<\/p>\n<p>Conditional checks in Bash are pretty straightforward as well.<\/p>\n<pre class=\"brush:php\">value=0\r\n\r\nif [ $value == 0 ]; then\r\n  echo \"Zero\"\r\nelse\r\n  echo \"Not Zero\"\r\nfi\r\n# Output: Zero<\/pre>\n<p>The <code>if<\/code> syntax is a bit strange but not too difficult to learn. Note the space inside of each outer edge square bracket for the <code>if<\/code> condition. This is important or the script won\u2019t work. In Bash, the semicolon is the equivalent of a new-line for your code. You could also place <code>then<\/code> on the next line instead of using a semicolon.<\/p>\n<p>For a second condition statement, you can use <code>elif<\/code> for else if. You will still need to follow the same <code>; then<\/code> pattern for that.<\/p>\n<p>Writing functions in Bash is very simple.<\/p>\n<pre class=\"brush:php\">cow() {\r\n  echo Moo\r\n}\r\n\r\ncow # Output: Moo<\/pre>\n<p>In bash, parameters passed from the console or to a function take a dollar number format, where the number indicates which position of the parameter it is.<\/p>\n<pre class=\"brush:php\">cow_eat() {\r\n  echo Cow chews $1\r\n}\r\n\r\ncow_eat grass # Output: Cow chews grass<\/pre>\n<p>Bash loads a <code>.bashrc<\/code> file from your home directory for all its defaults. You can place as many functions as you want in there and they will be available on the command line at any time as if they\u2019re a program on your system.<\/p>\n<p>Now let\u2019s jump into a more advanced Bash script and cover its details.<\/p>\n<pre class=\"brush:php\">#!\/bin\/bash\r\n#\r\n# Egg Timer - for taking periodic breaks from desk work\r\n#\r\n\r\nlimit=45\r\nsummary=\"The mind becomes better with movement\"\r\nendmessage=\"Take a break! Take a short stroll.\"\r\necho -n $limit\r\n\r\nsleeper() {\r\n  number=$1\r\n  clock=60\r\n  while [ $clock != 0 ]; do\r\n    let \"clock = $clock - 1\"\r\n    [ $((number%2)) -eq 0 ] &amp;&amp; echo -n '.' || echo -n '*'\r\n    sleep 1\r\n  done\r\n}\r\n\r\nwhile true; do\r\n  counter=0\r\n  while [ $counter != $limit ]; do\r\n    sleeper $counter\r\n    let \"counter = $counter + 1\"\r\n    \r\n    printf '\\r%2d' $(($limit - $counter))\r\n  done\r\n  if [ $counter == $limit ]; then\r\n    echo\r\n    notify-send -u critical -i appointment \"$summary\" \"$endmessage\"\r\n    echo -e '\\a' &gt;&amp;2\r\n    xdg-open https:\/\/www.youtube.com\/watch?v=Hj0jzepk0WA\r\n  fi\r\ndone<\/pre>\n<p>This egg timer script runs a countdown clock of 45 minutes, after which it will run three commands.<\/p>\n<p>The first is a desktop notification for Linux systems with the text given to remind you of the importance of taking a break. The next command will make the system beep if it\u2019s supported (it\u2019s a very old-school system command), and the last command will open the default web browser in Linux and play a series of Rocky Balboa motivational workout music scenes from YouTube.<\/p>\n<p>These commands can be changed to whatever is native for your particular operating system to achieve the same result.<\/p>\n<p>Let\u2019s go briefly over a few new things this script introduces. The <code>while<\/code> loop is like <code>if<\/code>, except it uses <code>do<\/code> instead of <code>then<\/code> and closes with <code>done<\/code> instead of <code>fi<\/code>. Variable assignment can also be done with <code>let<\/code> and a string which permits spaces.<\/p>\n<p>The line with <code>number%2<\/code> in it is the Bash way of implementing ternary operation where the value after <code>&amp;&amp;<\/code> is what is executed when the first block is evaluated as true and the code after <code>||<\/code> is what is executed if the block evaluates to false.<\/p>\n<p>The <code>-eq 0<\/code> within that same block is an equality operator of <strong>test<\/strong>. The square brackets for conditional situations are the equivalent of using the <strong>test<\/strong> command in Bash. You can look up what conditions are available for that by typing <code>man test<\/code>.<\/p>\n<p>The <code>$(())<\/code> in the <code>printf<\/code> line allows for arithmetic expansion and evaluation in the script.<\/p>\n<h2>Parallel Execution<\/h2>\n<p>Computer technology has reached a peak as far as single core speeds can achieve. So today, we are adding more cores for more added power.<\/p>\n<p>But the programs we write and have been used to writing are largely written for a single core in the CPU. One of the ways we can take advantage of more cores is by simply running tasks in parallel. In Bash, we have the <strong>xargs<\/strong> command that will allow us to execute tasks up to the amount of cores our system has.<\/p>\n<p>Here\u2019s a simple example script of writing 10 values:<\/p>\n<pre class=\"brush:php\">value=0\r\nwhile [ $value -lt 10 ]; do\r\n  value=$(($value + 1))\r\n  echo $value\r\ndone<\/pre>\n<p>In Bash, we can pipe the output of any command into the streaming input of the next with the pipe operator <code>|<\/code>. <strong>xargs<\/strong> allows that stream to be used as regular command-line input rather than a stream. When run, the above script will print the numbers 1 to 10 in order. But if we split the work into a parallel workload across the system\u2019s cores, the order will vary.<\/p>\n<pre class=\"brush:php\"># Command\r\nbash example.sh | xargs -r -P 4 -I VALUE bash -c \"echo VALUE\"\r\n\r\n# Output\r\n2\r\n1\r\n4\r\n3\r\n6\r\n5\r\n7\r\n8\r\n9\r\n10<\/pre>\n<p>The <code>-r<\/code> option on <strong>xargs<\/strong> says to not do anything if the input it is given is empty. The <code>-P 4<\/code> tells <strong>xargs<\/strong> up to how many CPU cores we\u2019re going to utilize in parallel. The <code>-I VALUE<\/code> tells <strong>xargs<\/strong> what string to substitute from the following command with the input passed in from the pipe operator. The <code>-c<\/code> parameter we\u2019re handing to the Bash command says to run the following quoted string as a Bash command.<\/p>\n<p>If only one instance of <strong>xargs<\/strong> is running, it will use up to the maximum amount of CPU cores you have available at a pretty good performance improvement. If you run <strong>xargs<\/strong> in multiple shells this way and they collectively are trying to use more cores than you have, you will eliminate nearly all your performance improvement.<\/p>\n<p>Here\u2019s a real world example:<\/p>\n<pre class=\"brush:php\">crunch 6 6 abcdef0123456789 --stdout | \\\r\nxargs -r -P 4 -I PASSWORD bash -c \\\r\n\"! aescrypt -d -p 'PASSWORD' -o 'PASSWORD' encrypted_file.aes \\\r\n2&gt;\/dev\/null; if [[ -s \\\"PASSWORD\\\" ]]; then exit 255; fi\"<\/pre>\n<p>The <a href=\"https:\/\/sourceforge.net\/projects\/crunch-wordlist\/\">crunch<\/a> command is a tool that will allow you to iterate through every possible character sequence for a given length and character set. <a href=\"https:\/\/www.aescrypt.com\/\">aescrypt<\/a> is a command-line encryption\/decryption tool for files. What the above is good for is trying to reopen your encrypted file with the forgotten password when you know that the password is six characters long and is only in lowercase hexadecimal.<\/p>\n<p>This password length would be simple to crack on most any system. Once you go beyond eight characters in length and with greater variety, this becomes a much less plausible solution for decrypting your forgotten password data as the amount of time to attempt the solutions rises exponentially.<\/p>\n<p>The Bash code in this example is for handling exit statuses and verifying whether an output file was created. The bang <code>!<\/code> tells it to ignore the failing exit status and allows <strong>xargs<\/strong> to continue on. The <code>-s<\/code> flag in <strong>test<\/strong> simply checks the truthiness of whether a file by that name exists in the current directory. If the file does exist, then we raise a failing exit status to cease any more work with <strong>crunch<\/strong> and <strong>xargs<\/strong>.<\/p>\n<h2>fish shell<\/h2>\n<p>Bash has been around for a very long time. There are a bunch of alternative shells available to Bash. <a href=\"https:\/\/fishshell.com\/\">fish shell<\/a> is one that I find quite enjoyable. There can be many advantages to switching shells as newer shells are built with the lessons learned from the old ones and are better in many ways.<\/p>\n<p>It features a frontend configuration tool that you can access via your web browser. It also provides a cleaner scripting language, beautiful autocompletion generated from your system\u2019s man pages, a dynamic shell display depending on your own script configuration, and it\u2019s quite colorful.<\/p>\n<p>Continuing from the forgotten password example, let\u2019s say you remembered a handful of words that made up the password but you don\u2019t remember the order. So you write your own Ruby script to permute the possibilities and print each one out to the command line. You could then write a fish shell script to process each line like:<\/p>\n<pre class=\"brush:php\">for password in (ruby script.rb)\r\n  if test -s the_file\r\n    break\r\n  else\r\n    aescrypt -d -p $password the_file.aes 2&gt;\/dev\/null\r\n  end\r\nend<\/pre>\n<p>This looks a lot more like the scripting languages we use and love every day. And you can write out individual fish shell functions in a specific functions directory as an improvement for your command-line tool set. Here\u2019s my fish shell function for pulling GitHub pull requests.<\/p>\n<pre class=\"brush:php\">function git-pr\r\n  set -l id $argv[1]\r\n  if test -z $id\r\n    echo \"Need Pull request number as argument\"\r\n    return 1\r\n  end\r\n  git fetch origin pull\/$id\/head:pr_$id\r\n  git checkout pr_$id\r\nend<\/pre>\n<p>The fish shell requires commands from the command line to be indexed from <code>$argv<\/code>. One really nice thing about this scripting language is it lets you declare the scope for variables where <code>set -l id<\/code> above sets the <strong>id<\/strong> variable as a locally scoped variable. You\u2019ll notice the <code>$id<\/code> can be placed in any of the following commands, allowing them to substitute the variable number into those commands as is. So if I run <code>git-pr 77<\/code>, it will pull and checkout the PR #77 from the project of the directory I reside in.<\/p>\n<h2>Summary<\/h2>\n<p>The world of shell scripting is a vastly large, as you can see in the <a href=\"http:\/\/tldp.org\/LDP\/abs\/html\/\">Advanced Bash-Scripting Guide<\/a>. I hope that you\u2019ve been enlightened to new possibilities with shell scripting.<\/p>\n<p>Of course, while Bash is powerful and stable, it is quite old and has its own headaches. Newer shells such as fish shell overcome many of those headaches and help make our systems experiences more enjoyable. Despite its age, Bash is one of those predominant things that you\u2019ll likely need to master, so if it\u2019s feasible for you, I recommend checking out some of the other shells available.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/blog.codeship.com\/lets-talk-about-shell-scripting\/\">Let&#8217;s Talk About Shell Scripting<\/a> from our <a href=\"http:\/\/www.systemcodegeeks.com\/join-us\/scg\/\">SCG partner<\/a> Daniel P. Clark at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the majority of tasks for a system. Many of the commands that need to be executed to complete a task can be grouped together in a script to help avoid repetition when &hellip;<\/p>\n","protected":false},"author":280,"featured_media":185,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-3034","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shell-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Let&#039;s Talk About Shell Scripting - System Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the\" \/>\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.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Let&#039;s Talk About Shell Scripting - System Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/\" \/>\n<meta property=\"og:site_name\" content=\"System Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/systemcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-17T13:15:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Daniel P. Clark\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@systemcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@systemcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel P. Clark\" \/>\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.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/\"},\"author\":{\"name\":\"Daniel P. Clark\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/fe61769541717b319684557ccc671d46\"},\"headline\":\"Let&#8217;s Talk About Shell Scripting\",\"datePublished\":\"2017-08-17T13:15:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/\"},\"wordCount\":1627,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"articleSection\":[\"Shell Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/\",\"name\":\"Let's Talk About Shell Scripting - System Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"datePublished\":\"2017-08-17T13:15:07+00:00\",\"description\":\"Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the\",\"breadcrumb\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#primaryimage\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.systemcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Shell Scripting\",\"item\":\"https:\/\/www.systemcodegeeks.com\/category\/shell-scripting\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Let&#8217;s Talk About Shell Scripting\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"name\":\"System Code Geeks\",\"description\":\"Operating System Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/systemcodegeeks\",\"https:\/\/x.com\/systemcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/fe61769541717b319684557ccc671d46\",\"name\":\"Daniel P. Clark\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3a7b206ab49448c8e95961a5dd42f75b023aa8368e55f1e19fa54c9473176af3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3a7b206ab49448c8e95961a5dd42f75b023aa8368e55f1e19fa54c9473176af3?s=96&d=mm&r=g\",\"caption\":\"Daniel P. Clark\"},\"description\":\"Daniel P. Clark is a freelance developer, as well as a Ruby and Rust enthusiast. He writes about Ruby on his personal site.\",\"sameAs\":[\"https:\/\/blog.codeship.com\"],\"url\":\"https:\/\/www.systemcodegeeks.com\/author\/daniel-clark\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Let's Talk About Shell Scripting - System Code Geeks - 2026","description":"Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the","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.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/","og_locale":"en_US","og_type":"article","og_title":"Let's Talk About Shell Scripting - System Code Geeks - 2026","og_description":"Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the","og_url":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/","og_site_name":"System Code Geeks","article_publisher":"https:\/\/www.facebook.com\/systemcodegeeks","article_published_time":"2017-08-17T13:15:07+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","type":"image\/jpeg"}],"author":"Daniel P. Clark","twitter_card":"summary_large_image","twitter_creator":"@systemcodegeeks","twitter_site":"@systemcodegeeks","twitter_misc":{"Written by":"Daniel P. Clark","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#article","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/"},"author":{"name":"Daniel P. Clark","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/fe61769541717b319684557ccc671d46"},"headline":"Let&#8217;s Talk About Shell Scripting","datePublished":"2017-08-17T13:15:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/"},"wordCount":1627,"commentCount":0,"publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","articleSection":["Shell Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/","url":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/","name":"Let's Talk About Shell Scripting - System Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#primaryimage"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","datePublished":"2017-08-17T13:15:07+00:00","description":"Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the","breadcrumb":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#primaryimage","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/lets-talk-shell-scripting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.systemcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Shell Scripting","item":"https:\/\/www.systemcodegeeks.com\/category\/shell-scripting\/"},{"@type":"ListItem","position":3,"name":"Let&#8217;s Talk About Shell Scripting"}]},{"@type":"WebSite","@id":"https:\/\/www.systemcodegeeks.com\/#website","url":"https:\/\/www.systemcodegeeks.com\/","name":"System Code Geeks","description":"Operating System Developers Resource Center","publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.systemcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.systemcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/systemcodegeeks","https:\/\/x.com\/systemcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/fe61769541717b319684557ccc671d46","name":"Daniel P. Clark","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3a7b206ab49448c8e95961a5dd42f75b023aa8368e55f1e19fa54c9473176af3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3a7b206ab49448c8e95961a5dd42f75b023aa8368e55f1e19fa54c9473176af3?s=96&d=mm&r=g","caption":"Daniel P. Clark"},"description":"Daniel P. Clark is a freelance developer, as well as a Ruby and Rust enthusiast. He writes about Ruby on his personal site.","sameAs":["https:\/\/blog.codeship.com"],"url":"https:\/\/www.systemcodegeeks.com\/author\/daniel-clark\/"}]}},"_links":{"self":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/3034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/users\/280"}],"replies":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/comments?post=3034"}],"version-history":[{"count":0,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/3034\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media\/185"}],"wp:attachment":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media?parent=3034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/categories?post=3034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/tags?post=3034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}