# False deprecation warnings for escaped dollar sign in shell command?

**URL:** <https://forum.ansible.com/t/false-deprecation-warnings-for-escaped-dollar-sign-in-shell-command/13917>\
**Category:** Ansible Project\
**Created:** [November 15, 2013, 4:02pm UTC](https://forum.ansible.com/t/false-deprecation-warnings-for-escaped-dollar-sign-in-shell-command/13917 "2013-11-15T16:02:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Sage](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@Kevin\_Sage](https://forum.ansible.com/u/Kevin_Sage)\
**Post date:** [November 15, 2013, 4:02pm UTC](https://forum.ansible.com/t/false-deprecation-warnings-for-escaped-dollar-sign-in-shell-command/13917/1 "2013-11-15T16:02:42Z")

</div>

Greetings all,

This is a somewhat contrived example because the actual command I’m running is much longer/uglier, but if I have something like this:

- name: awk a file for no good reason  
shell: awk ‘{print $2}’ /some/file \> /some/other/file

Then I’m getting a deprecation warning:

2013-11-15 00:48:54,976 p=32209 u=root | [DEPRECATION WARNING]: Legacy variable subsitution, such as using ${foo} or  
$foo instead of {{ foo }} is currently valid but will be phased out and has  
been out of favor since version 1.2. This is the last of legacy features on our  
deprecation list. You may continue to use this if you have specific needs for  
now. This feature will be removed in version 1.6. Deprecation warnings can be  
disabled by setting deprecation\_warnings=False in ansible.cfg.

The shell command seems to work just fine, but I’m not sure if the deprecation warning is because it’s falsely detecting the escaped “$2” in the shell command as an ansible variable, or if there really is a problem with my command and it just happens to be working anyway.

Can I safely ignore this warning, or is this signalling another issue with the shell command syntax?

Thanks!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [November 15, 2013, 4:07pm UTC](https://forum.ansible.com/t/false-deprecation-warnings-for-escaped-dollar-sign-in-shell-command/13917/2 "2013-11-15T16:07:41Z")

</div>

Github for bugs, not the mailing list please.

This is coded to see if the template call changes the string but we’ll see if it’s reproducible.

Thanks!

– Michael

---

<div class="post-metadata">

**Author:** ![Kevin\_Sage](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@Kevin\_Sage](https://forum.ansible.com/u/Kevin_Sage)\
**Post date:** [November 15, 2013, 10:07pm UTC](https://forum.ansible.com/t/false-deprecation-warnings-for-escaped-dollar-sign-in-shell-command/13917/3 "2013-11-15T22:07:40Z")

</div>

Sorry, wasn’t sure if it was a bug or expected. Issue has been filed in GitHub. Thanks!
