I use shell a fair amount and have occasionally run into some similar 
issues. I sometimes wrap the entire shell command in single or double 
quotes, if it contains a special character. An example:

- name: determine firefox version
  shell: "firefox -v | cut -d ' ' -f3"
  register: ffversion


I also used double quotes with sed commands in the past, but lineinfile 
works just as well. However, I sometimes have to play with the quote 
placement for a while to make lineinfile work.

Joanna

On Wednesday, March 4, 2015 at 4:17:34 PM UTC-6, Jim McMahon wrote:
>
> The shell module seems to escape special characters like \ and ".   Is 
> there a way so that the shell module doesn't escape these characters? Are 
> there any tips on how handle situations where you want double quotes?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8c78206c-85aa-4279-9227-f2380b12f9d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to