As Douglas Leeder said you need a separate process for timeout to signal to. Workaround by exporting function to subshells and running subshell manually.
export -f echoFooBar
timeout 10s bash -c echoFooBar
More Related Contents:
- Difference between single and double quotes in Bash
- Command not found error in Bash variable assignment
- How to check if a variable is set in Bash
- Return value in a Bash function
- Shell equality operators (=, ==, -eq)
- redirect COPY of stdout to log file from within bash script itself
- Shell script to delete directories older than n days
- Shell: How to call one shell script from another shell script?
- How to redirect output of an entire shell script within the script itself?
- Quick-and-dirty way to ensure only one instance of a shell script is running at a time
- Process all arguments except the first one (in a bash script)
- How to represent multiple conditions in a shell if statement?
- How to split one string into multiple strings separated by at least one space in bash shell?
- Generating permutations using bash
- What is the difference between ${var}, “$var”, and “${var}” in the Bash shell?
- What does the Bash operator
- Remove duplicate entries in a Bash script [duplicate]
- How to parse a CSV in a Bash script?
- How to check if running in Cygwin, Mac or Linux?
- Using getopts inside a Bash function
- What’s a concise way to check that environment variables are set in a Unix shell script?
- Source files in a bash script
- executing shell command in background from script [duplicate]
- Escaping forward slashes in sed command [duplicate]
- How to effectively abort the execution of a Bash script from a function
- Temporarily change current working directory in bash to run a command [duplicate]
- How to break out of a loop in Bash?
- How to tell if a string is not defined in a Bash shell script
- BASH: Writing a Script to Recursively Travel a Directory of N Levels
- How to grep for case insensitive string in a file?