• 0

How to pass arguments to a bash function?

#!/bin/bash

function foo()
{
    # Hello
    echo "First Argument = $1"

    # World
    echo "Second Argument = $2"
}

foo Hello World