← All Exercises

Function Arguments and Return

basicbash~10min

Background

Functions in bash enable code reuse and modular script organization.

Problem

Create a bash function that takes named arguments and returns a computed value.

Input

Function arguments

Output

Computed return value

Sample tests

Sample 1

Input: calculate_area 5 10
Expected: 50

Your solution

Learning objective

Learn bash function design and argument handling