Suppose you have a filename like `place.type-date.log` in the variable `file`, and you want to store the part of the filename before the first dot in another variable called `first`. In that case, you may do that using a standard parameter substitution.
```sh
first=${file%%.*}
```
The above removes the longest suffix matching the shell pattern `.*` from the value of `$file` and stores the result in `first`.
Using `%` in place of `%%` would remove the shortest matching suffix instead, leaving `place.type-date`. Using `#` or `##` in place of `%` and `%%` would remove prefix strings rather than suffix strings.
---
Your code does not work because `$file` is the string `place.type-date.log`, not a command. You may have attempted to do something like
```sh
first=$( echo "$file" | awk -F '[.-]' '{ print $1 }' )
```
But this is more complicated than it needs to be.