Access arguments to Bash script inside a function [duplicate]

Usually you just pass them as parameters to the function at call time.

The (uglier) alternative is to put them in global variables.

Leave a Comment