function f { if [[ "$1" == *.cpp ]] then echo "end with .cpp"; else echo "this file isnt a cpp file" fi }