Cant save output to file?

Stevens-MacBook-Pro:ansible stevenwiliams$ ansible IOL_Routers -i ./hosts -m raw -a “show run” -u cisco -k > filetest

-bash: filetest: Permission denied

Stevens-MacBook-Pro:ansible stevenwiliams$

what am I missing here??

Steven,

I use tee so I can see the output and pass the full path.

eg.
Stevens-MacBook-Pro:ansible stevenwiliams$ ansible IOL_Routers -i ./hosts -m raw -a “show run” -u cisco -k | tee /tmp/filetest

The issue may be with the directory permissions.

Issue was permissions within the ansible folder itself. directed to another directory and it worked.