{"id":12236,"date":"2023-06-11T10:51:59","date_gmt":"2023-06-11T10:51:59","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=12236"},"modified":"2023-11-26T11:39:35","modified_gmt":"2023-11-26T11:39:35","slug":"bash-input-parameter","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/","title":{"rendered":"How to Use Bash Input Parameter? [5 Practical Cases]"},"content":{"rendered":"<p style=\"text-align: justify;\"><a href=\"https:\/\/linuxsimply.com\/bash-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>Bash<\/strong><\/a>, the popular command line interpreter and scripting language, offers powerful capabilities to customize and control scripts using input parameters. In this article, I\u2019ll explore practical examples to demonstrate how to handle <strong>bash input parameter<\/strong> effectively. Whether you\u2019re new to Bash or an experienced user, mastering input parameters can enhance your scripting skills and streamline your workflow. Let\u2019s delve into the world of Bash input parameters and unlock their full potential.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Key_Takeaways\" >Key Takeaways<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Special_Characters_and_Bash_Input_Parameter\" >Special Characters and Bash Input Parameter<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Free_Downloads\" >Free Downloads<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#5_Practical_Cases_of_Input_Parameter_in_Bash_Scripting\" >5 Practical Cases of Input Parameter in Bash Scripting<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Case_01_Display_the_Passed_Parameter\" >Case 01: Display the Passed Parameter<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Case_02_Assign_Provided_Arguments_to_Bash_Variable\" >Case 02: Assign Provided Arguments to Bash Variable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Case_03_Check_Whether_the_Passed_Parameter_is_NULL\" >Case 03: Check Whether the Passed Parameter is NULL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Case_04_Reading_Multiple_Arguments_With_%E2%80%9Cfor%E2%80%9D_Loop\" >Case 04: Reading Multiple Arguments With &#8220;for&#8221; Loop<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Case_05_Accessing_the_Number_of_Parameters_Passed\" >Case 05: Accessing the Number of Parameters Passed<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#People_Also_Ask\" >People Also Ask<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Key_Takeaways\"><\/span>Key Takeaways<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>Getting familiar with the bash input parameter.<\/li>\n<li>Accessing bash input.<\/li>\n<li>Passing multiple inputs into a bash script.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Special_Characters_and_Bash_Input_Parameter\"><\/span>Special Characters and Bash Input Parameter<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Bash programming follows some special characters. Some are listed below.<\/p>\n<ul>\n<li><strong>$<\/strong> \u2192 This symbol is used when we assign any value or get any value.<\/li>\n<li><strong>$@<\/strong> \u2192 Represents all the command line arguments provided.<\/li>\n<li><strong>$# \u2192 <\/strong>This counts the total number of passed parameters.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Free_Downloads\"><\/span>Free Downloads<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/bash-input-parameter.zip\" class=\"su-button su-button-style-default\" style=\"color:#000000;background-color:#E8F9FF;border-color:#bac8cc;border-radius:56px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#000000;padding:8px 26px;font-size:20px;line-height:30px;border-color:#effbff;border-radius:56px;text-shadow:0px 0px 0px #000000\"><i class=\"sui sui-download\" style=\"font-size:20px;color:#1AA1D6\"><\/i> Download the Practice Files<\/span><\/a><\/div>\n<h2><span class=\"ez-toc-section\" id=\"5_Practical_Cases_of_Input_Parameter_in_Bash_Scripting\"><\/span>5 Practical Cases of Input Parameter in Bash Scripting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong>bash input parameter<\/strong> is one of the most integral parts of bash scripting. Here I have listed some scripts that include bash input parameters.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Case_01_Display_the_Passed_Parameter\"><\/span>Case 01: Display the Passed Parameter<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can easily display the parameter you passed to the terminal. Here I will pass two parameters while running a script. This script will print the passed parameters to the terminal. to do the same follow the steps below:<\/p>\n<p><span style=\"color: #800080;\"><strong><a id=\"you-can-follow-this-section\"><\/a>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a At first, open the <strong>Ubuntu<\/strong> Terminal.<\/p>\n<p>\u278b Then, execute the following command into the terminal.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">nano parameter.sh<\/code><\/pre>\n<p>\u278c This will open a file named <strong>parameter.sh<\/strong>. Now, type the following line into the file, press <strong>CTRL+S<\/strong> to save, then <strong>CTRL+X<\/strong> to close the file.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\necho &quot;First Parameter: $1&quot; #Printing the first parameter\necho &quot;Second Parameter: $2&quot; #Printing the second parameter<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">The Bash script starts with the <strong>#!\/bin\/bash<\/strong> line which specifies that it is a bash script. Then <strong>echo &#8220;First Parameter: $1&#8221;<\/strong> prints \u2018First Parameter: $1\u2019 where $1 fetches the value of the first parameter and puts that in the place of \u2018$1\u2019. Then <strong>echo &#8220;Second Parameter: $2&#8221;<\/strong> prints \u2018Second Parameter: $2\u2019 where $2 fetches the value of the second parameter and puts that in the place of \u2018$1\u2019.<br \/>\n<\/div><\/div>\n<p>\u278d Now, run the following command into the terminal to run the <strong>parameter.sh<\/strong> bash script passing <strong>10<\/strong> and <strong>95<\/strong> as parameters.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">bash parameter.sh 10 95<\/code><\/pre>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-12270 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/1-parameter-script-output.png\" alt=\"The bash script has printed the two parameters passed into the script.\" width=\"825\" height=\"159\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/1-parameter-script-output.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/1-parameter-script-output-300x58.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/1-parameter-script-output-768x148.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>The above image shows that two parameters <strong>10<\/strong> and <strong>95<\/strong> are successfully passed to the bash script.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Case_02_Assign_Provided_Arguments_to_Bash_Variable\"><\/span>Case 02: Assign Provided Arguments to Bash Variable<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">While executing the Bash script, it creates the necessary bash variables. Here I will pass two parameters to the bash script. And the bash script will eventually create a bash variable and print it to the terminal. You can follow the scripts to do the same.<\/p>\n<div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#333333;\">You can follow the <a href=\"#you-can-follow-this-section\"><strong>steps of Case 01<\/strong><\/a> to know about creating and saving shell scripts.<\/div><\/div>\n<p><span style=\"color: #800080;\"><strong>Script (bashvar.sh) &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\na=$1\nb=$2\n\np=$(($a*$b))\n\necho &quot;Product of $a and $b is: $p&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"><strong>a=$1<\/strong> assigns the value of the first parameter to \u2018a\u2019 and <strong>b=$2<\/strong> assigns the value of the second parameter to \u2018b\u2019. Then <strong>p=$(($a*$b))<\/strong> does a mathematical multiplication of a and b and keeps the result on the new bash variable p. Afterwards, <strong>echo \u201cProduct of $a and $b is: $p\u201d<\/strong> prints \u2018Product of $a and $b is: $p\u2019 where $a, $b and $p fetch the value of a, b and p and put them on the place of $a, $b and $p respectively.<br \/>\n<\/div><\/div>\n<p>Now, execute the following command into the terminal to pass the two-parameter 2 and 5 to the <strong>bashvar.sh<\/strong> bash script.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">bash bashvar.sh 2 5<\/code><\/pre>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-12271 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/2-bashvar-script-output.png\" alt=\"The bash script has created a bash variable and print it on the terminal.\" width=\"700\" height=\"158\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/2-bashvar-script-output.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/2-bashvar-script-output-300x68.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/2-bashvar-script-output-766x173.png 766w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The above image shows that your two passed parameters have created a bash variable which has been printed on the terminal.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Case_03_Check_Whether_the_Passed_Parameter_is_NULL\"><\/span>Case 03: Check Whether the Passed Parameter is NULL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can check whether your passed parameter is <strong>NULL<\/strong> or not. Here I will develop a bash script and then pass a parameter to this script to check whether the parameter is <strong>NULL<\/strong> or not. To achieve so you can follow the given script.<\/p>\n<div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#333333;\">You can follow the <a href=\"#you-can-follow-this-section\"><strong>steps of Case 01<\/strong><\/a> to know about creating and saving shell scripts.<\/div><\/div>\n<p><span style=\"color: #800080;\"><strong>Script (nullchk.sh) &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nif [[ -z $1 ]];\nthen\necho &#039;No Parameter Passed!&#039;\n\nelse\necho &quot;The Parameter is: $1&quot;\n\nfi<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"><strong>if [[ -z $1 ]];<\/strong> initiates the <strong>if else<\/strong> condition and the condition is specified inside the double braces \u2019<strong>[[ ]]\u2019.<\/strong> Here the condition is to check the equality of the variable with empty or null. If so then the <strong>echo &#8216;No Parameter Passed!&#8217;<\/strong> command will be executed which will print \u2018&#8217;No Parameter Passed!\u2019 on the terminal. If the condition is false, which means the variable is not empty or null then the <strong>echo &#8220;The Parameter is: $1&#8221;<\/strong> command will be executed which will print \u2018The Parameter is: &lt;variable&gt;\u2019. Here, &lt;variable&gt; is the parameter you passed. <strong>fi<\/strong> marks the end of the <strong>if else<\/strong> block.<br \/>\n<\/div><\/div>\n<p>Now, execute the following command into the terminal to run the bash script and pass a parameter.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">bash nullchk.sh<\/code><\/pre>\n<pre><code class=\"language-bash\" data-line=\"\">bash nullchk.sh 5<\/code><\/pre>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-12272 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/3-nullchk-script-output.png\" alt=\"The bash script has checked whether the passed parameter is null or not.\" width=\"636\" height=\"249\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/3-nullchk-script-output.png 636w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/3-nullchk-script-output-300x117.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/3-nullchk-script-output-766x300.png 766w\" sizes=\"(max-width: 636px) 100vw, 636px\" \/>The former image illustrates that the bash scripts can check whether a parameter is <strong>NULL<\/strong> or not.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Case_04_Reading_Multiple_Arguments_With_%E2%80%9Cfor%E2%80%9D_Loop\"><\/span>Case 04: Reading Multiple Arguments With &#8220;for&#8221; Loop<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Here I will develop a bash script that can take <strong>multiple parameters<\/strong> from the terminal and then print them on the terminal. To do the same, follow the below script.<\/p>\n<div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#333333;\">You can follow the <a href=\"#you-can-follow-this-section\"><strong>steps of Case 01<\/strong><\/a> to know about creating and saving shell scripts.<\/div><\/div>\n<p><span style=\"color: #800080;\"><strong>Script (multiarg.sh) &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nfor i in $@\ndo\necho -e &quot;$i\\n&quot;\n\ndone<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"><strong>for i in $@<\/strong>\u00a0 initiates a <strong>for loop<\/strong> and takes the first parameter from all the parameters which are passed to the scripts and sets as <strong>i<\/strong> then execute the <strong>echo -e &#8220;$i\\n&#8221;<\/strong> command which prints the variable on the terminal. Here <strong>-e<\/strong> enables the interpretation of backslash escapes, allowing the newline character to be recognized. After executing this, the next parameter is set as i and the same task is executed till the last parameter. The <strong>done<\/strong> marks the end of the <strong>for loop<\/strong>.<br \/>\n<\/div><\/div>\n<p>Now, execute the following command into the terminal to multiple parameters to bash the script.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">bash multiplearg.sh 1 2 33 45 1 \u201chi\u201d<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12273 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/4-multiplearg-script-output.png\" alt=\"The bash script has printed all the parameters passed to the script.\" width=\"825\" height=\"450\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/4-multiplearg-script-output.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/4-multiplearg-script-output-300x164.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/4-multiplearg-script-output-766x418.png 766w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>The above image illustrates that the bash script takes multiple parameters and prints them on the terminal.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Case_05_Accessing_the_Number_of_Parameters_Passed\"><\/span>Case 05: Accessing the Number of Parameters Passed<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Here I will develop a bash script that can <strong>count<\/strong> the number of parameters passed. To achieve so, you can follow the below script<\/p>\n<div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#333333;\">You can follow the <a href=\"#you-can-follow-this-section\"><strong>steps of Case 01<\/strong><\/a> to know about creating and saving shell scripts.<\/div><\/div>\n<p><span style=\"color: #800080;\"><strong>Script (parameternum.sh) &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\necho &quot;The Number of Parameter Passed In are: $#&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">The <strong>echo &#8220;The Number of Parameter Passed In are: $#&#8221;<\/strong> command prints the \u2018The Number of Parameter Passed In are: $#\u2019 where $# is replaced by the total number of parameters passed to the script.<br \/>\n<\/div><\/div>\n<p>Now, execute the following command into the terminal to multiple parameters to bash the script.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">bash parameternum.sh 1 5 3 5<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12274 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/5-parameter-number-script-output.png\" alt=\"The bash script has counted the number of parameters passed to the script.\" width=\"700\" height=\"153\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/5-parameter-number-script-output.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/5-parameter-number-script-output-300x66.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/5-parameter-number-script-output-764x167.png 764w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The above image illustrates that the bash script counts the total number of parameters passed.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In conclusion, mastering <strong>Bash<\/strong> <strong>input parameter<\/strong>s is essential for enhancing your scripting capabilities. By utilizing them effectively, you can create dynamic and versatile scripts that handle various scenarios. Through practical examples, I\u2019ve demonstrated the power and flexibility of input parameters in Bash. Incorporating these parameters into your scripts will streamline your process, improve efficiency, and empower you as a Bash <strong>programmer<\/strong>. Unlock the full potential of Bash by leveraging input parameters. Happy scripting!<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"su-accordion su-u-trim\">\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>How do I pass input to a bash script?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> You have to just type the input you want to pass to your <strong>bash script<\/strong> after the name of your bash script. <\/div><\/div>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>What are the different types of parameters in Bash?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Generally, Bash has three parameter types. These are <strong>variables<\/strong>, <strong>positional<\/strong>, and <strong>special parameters<\/strong>. <\/div><\/div>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>How do I set variables in bash?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> The easiest way to set environment variables in Bash is to use the \u201c<strong>export<\/strong>\u201d keyword followed by the variable name, an equal sign and the value to be assigned to the environment variable. <\/div><\/div>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>Are there data types in bash?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> No data types are specific here. In Bash, a variable might contain a <strong>number<\/strong>, a <strong>character<\/strong>, or a <strong>string of characters<\/strong>. The user does not need to define a variable priorly, he\/she just needs to assign a value to its reference and it will be created automatically.<\/div><\/div>\n<\/div>\n<p><span style=\"font-size: 18pt; color: #003366;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-argument\/\" target=\"_blank\" rel=\"noopener\">How to Use Input Argument in Bash [With 4 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/read-input\/\" target=\"_blank\" rel=\"noopener\">How to Read User Input in Bash [5 Practical Cases]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/wait-for-input\/\" target=\"_blank\" rel=\"noopener\">How to Wait for User Input in Bash [With 4 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/read-csv\/\" target=\"_blank\" rel=\"noopener\">How to Read CSV Files in Bash? [2 Methods]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<p><strong>&lt;&lt; Go Back to <span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Input&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1065857,&quot;3&quot;:{&quot;1&quot;:0},&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/\" target=\"_blank\" rel=\"noopener\">Bash Input<\/a><\/span> | <span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash I\/O&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1065857,&quot;3&quot;:{&quot;1&quot;:0},&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/\" target=\"_blank\" rel=\"noopener\">Bash I\/O<\/a><\/span> | <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\" target=\"_blank\" rel=\"noopener\">Bash Scripting Tutorial<\/a><\/strong><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;12236&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;How to Use Bash Input Parameter? [5 Practical Cases]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bash, the popular command line interpreter and scripting language, offers powerful capabilities to customize and control scripts using input parameters. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Use Bash Input Parameter? [5 Practical Cases]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#more-12236\" aria-label=\"Read more about How to Use Bash Input Parameter? [5 Practical Cases]\">Read more<\/a><\/p>\n","protected":false},"author":314894,"featured_media":12275,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[101],"class_list":["post-12236","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-bash-input","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Use Bash Input Parameter? [5 Practical Cases]<\/title>\n<meta name=\"description\" content=\"Discover the power of bash input parameter with this comprehensive guide. Learn how to harness their versalities in just a few steps.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Bash Input Parameter? [5 Practical Cases]\" \/>\n<meta property=\"og:description\" content=\"Discover the power of bash input parameter with this comprehensive guide. Learn how to harness their versalities in just a few steps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/dasgupta.susmit\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-11T10:51:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-26T11:39:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/bash-input-parameter-feature-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Susmit Das Gupta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Susmit Das Gupta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/\"},\"author\":{\"name\":\"Susmit Das Gupta\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/38abbef9a1053d9faec8935dc39f10fa\"},\"headline\":\"How to Use Bash Input Parameter? [5 Practical Cases]\",\"datePublished\":\"2023-06-11T10:51:59+00:00\",\"dateModified\":\"2023-11-26T11:39:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/\"},\"wordCount\":1509,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/bash-input-parameter-feature-image.png\",\"keywords\":[\"bash input\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/\",\"name\":\"How to Use Bash Input Parameter? [5 Practical Cases]\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/bash-input-parameter-feature-image.png\",\"datePublished\":\"2023-06-11T10:51:59+00:00\",\"dateModified\":\"2023-11-26T11:39:35+00:00\",\"description\":\"Discover the power of bash input parameter with this comprehensive guide. Learn how to harness their versalities in just a few steps.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/bash-input-parameter-feature-image.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/bash-input-parameter-feature-image.png\",\"width\":400,\"height\":400,\"caption\":\"Bash input parameter\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/input-parameter\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash Scripting Tutorial\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bash I\\\/O\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Bash Input\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/input-output\\\/input\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How to Use Bash Input Parameter? [5 Practical Cases]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/38abbef9a1053d9faec8935dc39f10fa\",\"name\":\"Susmit Das Gupta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Susmit-Das-Gupta-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Susmit-Das-Gupta-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Susmit-Das-Gupta-II-96x96.png\",\"caption\":\"Susmit Das Gupta\"},\"description\":\"Hello everyone. I am Susmit Das Gupta, currently working as a Linux Content Developer Executive at SOFTEKO. I am a Mechanical Engineering graduate from Bangladesh University of Engineering and Technology. Besides my routine works, I find interest in going through new things, exploring new places, and capturing landscapes. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dasgupta.susmit\",\"https:\\\/\\\/www.instagram.com\\\/susmit_dasgupta\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/susmitdasgupta\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/susmit\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Bash Input Parameter? [5 Practical Cases]","description":"Discover the power of bash input parameter with this comprehensive guide. Learn how to harness their versalities in just a few steps.","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:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Bash Input Parameter? [5 Practical Cases]","og_description":"Discover the power of bash input parameter with this comprehensive guide. Learn how to harness their versalities in just a few steps.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/dasgupta.susmit","article_published_time":"2023-06-11T10:51:59+00:00","article_modified_time":"2023-11-26T11:39:35+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/bash-input-parameter-feature-image.png","type":"image\/png"}],"author":"Susmit Das Gupta","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Susmit Das Gupta","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/"},"author":{"name":"Susmit Das Gupta","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/38abbef9a1053d9faec8935dc39f10fa"},"headline":"How to Use Bash Input Parameter? [5 Practical Cases]","datePublished":"2023-06-11T10:51:59+00:00","dateModified":"2023-11-26T11:39:35+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/"},"wordCount":1509,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/bash-input-parameter-feature-image.png","keywords":["bash input"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/","name":"How to Use Bash Input Parameter? [5 Practical Cases]","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/bash-input-parameter-feature-image.png","datePublished":"2023-06-11T10:51:59+00:00","dateModified":"2023-11-26T11:39:35+00:00","description":"Discover the power of bash input parameter with this comprehensive guide. Learn how to harness their versalities in just a few steps.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/bash-input-parameter-feature-image.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/06\/bash-input-parameter-feature-image.png","width":400,"height":400,"caption":"Bash input parameter"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/input-parameter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"Bash Scripting Tutorial","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/"},{"@type":"ListItem","position":3,"name":"Bash I\/O","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/"},{"@type":"ListItem","position":4,"name":"Bash Input","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/input\/"},{"@type":"ListItem","position":5,"name":"How to Use Bash Input Parameter? [5 Practical Cases]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/38abbef9a1053d9faec8935dc39f10fa","name":"Susmit Das Gupta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Susmit-Das-Gupta-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Susmit-Das-Gupta-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Susmit-Das-Gupta-II-96x96.png","caption":"Susmit Das Gupta"},"description":"Hello everyone. I am Susmit Das Gupta, currently working as a Linux Content Developer Executive at SOFTEKO. I am a Mechanical Engineering graduate from Bangladesh University of Engineering and Technology. Besides my routine works, I find interest in going through new things, exploring new places, and capturing landscapes. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/dasgupta.susmit","https:\/\/www.instagram.com\/susmit_dasgupta\/","https:\/\/www.linkedin.com\/in\/susmitdasgupta\/"],"url":"https:\/\/linuxsimply.com\/author\/susmit\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/12236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314894"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=12236"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/12236\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/12275"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=12236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=12236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=12236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}