// main file #!/bin/bash function main { while true; do read -p "prompt" string filter done } function filter { echo $string # this outputs correct /home/test/modules/m1 process "$string" return 0 } main exit // m1 #!/bin/bash #process wont be the only function in this file function process { echo $1 #doesn't output what i want return 0 } echo $2 #doesn't output what i want $1 "$2"