Script copy show running >*.txt

Hello everyone, I was trying to make a script to dump the show running config file to a text file, but it gives me error, remains in pending enable mode. What parameter should add more?

cat copy.running.sh vtysh enable sh runn> /config/config.txt exit

Greetings and thank you

not sure i’ve used enable before. anyway, this works for me:

cat runningconfig.sh

tmsh show running-config > /var/tmp/config.txt