Call function from another script

Hey, i got this 2 file. When i try to pick option 1, which is test1, it says ./test: test1: not found.
Any idea on how i can fix it?

#!/bin/sh

QUIT=0
`dirname $0`/testfile

while [ $QUIT -eq 0 ] ;
	do
		testmenu
		read option
	
		case $option in
			1)	test1	;;
			2)	test2 ;;
			3)	echo "Exit"
				QUIT=1;;
			?)	echo "Invalid Option\n"
		esac
	done
#!/bin/sh
test1()
{
	echo "it's working yay"

}	

You need to source it:

. "$(dirname "$0")/testfile"
1 Like

Oh right that "." , no wonder i feel like im forgetting something.
Thanks a lot Scrutinizer