What's wrong with the following code?
name='$filename | cut -f1 -d'.''
"test.exe" | cut -f1 -d'.'
You should be using $(command) when you want to execute a command in script/command.
So your line would be
name=$(echo $filename | cut -f 1 -d '.')
echoget the value of the variable
$filenameand send it to standard output
cutwill use the . as delimiter (also known as separator) for cutting the string into segments and by
-fwe select which segment we want to have in output
$()wrapper will get the output and return it's value