The count of arguments is in the shell variable "$#".. Common ways of dealing with this involve shell commands getopts and shift. For example: Frequently a script is written so that arguments can be passed in any order using flags. But tried on posix and bash shell , and the maxmium number of arguments you can pass to a script is 9. Next, the rm command will be executed with the ‘files’ variable to remove multiple files. Write a Bash script so that it receives arguments that are specified when the script is called from the command line. Let us see how to pass parameters to a Bash function. We can also read user input from command arguments, just like any other programming language. #!/bin/bash #The script demonstrates the use of variables entered at the command line. It lets you to describe arguments your script should take and then, you can generate the bash parsing code. echo "No -${OPTARG} argument found. arguments Arguments (Optional) Arguments passed to the Bash script. If the file exists then, it will print a remove message with the filename for ‘-v’ option. Bash (Bourne Again Shell) is a shell language build on-top of the original Bourne Shell which was distributed with V7 Unix in 1979 and became the standard for writing shell scripts. So before start processing, first, it is checking for the arguments passed to the script. Use this method when a script has to perform a slightly different function depending on the values of the input parameters, also called arguments. The argument N (exit status) can be passed to the exit command to indicate if a script is executed successfully (N = 0) or unsuccessfully (N != 0). Bash Script: Batch file rename to remove/change all characters illegal under a windows filesystem. Example of an if Statement Only $ bash