######################################### ## Concatenate a list of arguments with commas ## ## Outputs: ## Outputs all arguments as a single string, concatenated with commas ######################################### concatenate_with_commas() { local concatenated="" local string for string in "$@"; do if [[ "${concatenated}" == "" ]]; then concatenated+="${string}" else concatenated+=",${string}" fi done echo "${concatenated}" }