6. Default Parameter Values in FunctionsCreate a Bash script with a function named `greet` that takes two parameters: a name and a greeting. If no greeting is provided, it should default to "Hel…
4. Returning String Values from FunctionsCreate a Bash script with a function named `reverse_string` that takes a string as a parameter, reverses it, and returns the reversed string. Capture the retu…
10. Combining Multiple ConceptsCreate a Bash script with the following:→ A function named `file_info` that takes a filename as a parameter and prints the file type, size, and last modification date.→…
5. Using Positional Parameters in FunctionsWrite a Bash script with a function named `print_params` that prints the first three positional parameters passed to it. Call the function with at least thr…
3. Returning Integer Values from FunctionsWrite a Bash script with a function named `is_even` that takes an integer as a parameter and returns 0 if the number is even and 1 if the number is odd. Capt…
2. Passing Parameters to FunctionsCreate a Bash script with a function named `greet` that takes a single parameter (a name) and prints "Hello, [name]!". Call the function with at least two …
1. Basic Function DefinitionWrite a Bash script that defines a function named `hello` which prints "Hello, World!" to the terminal. Call the function in the script.
7. Recursion in FunctionsWrite a Bash script that defines a recursive function named `factorial` which calculates the factorial of a given number. The function should take a single parameter (the num…
8. Function with Multiple Return ValuesCreate a Bash script with a function named `get_user_info` that takes a username as a parameter and returns the user's ID and home directory. Capture the r…
9. Using `shift` to Process All Positional ParametersWrite a Bash script with a function named `process_args` that processes all positional parameters passed to it and prints each one. Use the `shift…