You attempted to use the ! command redirection with the f command.
Do not use the ! command redirection with the f command.