Memory Matrix

Functions in Bash

Posted in Computing Notes on January 21st, 2024 and tagged ,
Permalink https://memorymatrix.cloud/archives/41.html

Revised on January 27th, 2026 at 8:18 PM

This is the code for a function in Bash script.

 #!/bin/bash
 # Define a function
 greet() {
 echo "Hello, $1"
 }
 # Call the function with "World" as the argument
 greet "World"