Error when trying to grep something from a file

27 views
Skip to first unread message

Kallu Srikanth

unread,
Jun 26, 2018, 9:57:22 PM6/26/18
to Ansible Project
Hi,

dpiesa@cwypatchdev:/etc/ansible> ansible all -m command -a "cat /etc/oratab | grep -i ^AGENT | cut -f 2 -d :"

vmcwy60158.prod.acxiom.net | FAILED | rc=1 >>
cat: invalid option -- 'i'
Try `cat --help' for more information.non-zero return code

Can I get help please ? what am I missing above?

This is the expectation

[root@vmcwy60158 skallu]# cat /etc/oratab | grep -i ^AGENT | cut -f 2 -d :
/u01/app/oracle/product/12.1.0/agent12c/core/12.1.0.5.0



Kallu Srikanth

unread,
Jun 26, 2018, 10:03:17 PM6/26/18
to Ansible Project
Found the answer, should have used shell instead of command
Reply all
Reply to author
Forward
0 new messages