Usually you just pass them as parameters to the function at call time.
The (uglier) alternative is to put them in global variables.
More Related Contents:
- Some troubles with using sed and awk [closed]
- Why would a correct shell script give a wrapped/truncated/corrupted error message? [duplicate]
- Delete all but the most recent X files in bash
- Add a new element to an array without specifying the index in Bash
- Batch equivalent of Bash backticks
- How to find the difference in days between two dates?
- How to assign a heredoc value to a variable in Bash?
- Running script upon login in mac OS X [closed]
- Command substitution: backticks or dollar sign / paren enclosed? [duplicate]
- How do I use su to execute the rest of the bash script as that user?
- How to iterate over associative arrays in Bash
- How to process each output line in a loop?
- How to extract one column of a csv file
- bash: force exec’d process to have unbuffered stdout
- Set a parent shell’s variable from a subshell
- What does it mean in shell when we put a command inside dollar sign and parentheses: $(command)
- What is the ‘function’ keyword used in some bash scripts?
- How does bash tab completion work?
- How to add leading zeros for for-loop in shell? [duplicate]
- How to silence output in a Bash script?
- How to tell bash that the line continues on the next line
- Bash script store command output into variable
- How to find/replace and increment a matched number with sed/awk?
- Expand variables in sed
- Exclude a string from wildcard search in a shell
- Is there an elegant way to store and evaluate return values in bash scripts?
- Using groovy, how do you pipe multiple shell commands?
- How to add path with space in Bash variable
- Bash If-statement to check If string is equal to one of several string literals [duplicate]
- How to change a command line argument in Bash?