# how to retain stdout formatting when using adhoc commands (shell module)

**URL:** <https://forum.ansible.com/t/how-to-retain-stdout-formatting-when-using-adhoc-commands-shell-module/25283>\
**Category:** Ansible Project\
**Created:** [August 17, 2017, 6:32pm UTC](https://forum.ansible.com/t/how-to-retain-stdout-formatting-when-using-adhoc-commands-shell-module/25283 "2017-08-17T18:32:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeder](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@jeder](https://forum.ansible.com/u/jeder)\
**Post date:** [August 17, 2017, 6:32pm UTC](https://forum.ansible.com/t/how-to-retain-stdout-formatting-when-using-adhoc-commands-shell-module/25283/1 "2017-08-17T18:32:20Z")

</div>

Hey – when running adhoc commands (using shell module), the stdout returned from target systems is stripped of formatting. Is there a standard way to retain the formatting?

---

<div class="post-metadata">

**Author:** ![Mike\_Klebolt](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Mike\_Klebolt](https://forum.ansible.com/u/Mike_Klebolt)\
**Post date:** [August 17, 2017, 7:51pm UTC](https://forum.ansible.com/t/how-to-retain-stdout-formatting-when-using-adhoc-commands-shell-module/25283/2 "2017-08-17T19:51:48Z")

</div>

Not sure what exactly you mean. Is stdout\_lines what you’re looking for?

---

<div class="post-metadata">

**Author:** ![Jeremy\_Eder](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Jeremy\_Eder](https://forum.ansible.com/u/Jeremy_Eder)\
**Post date:** [August 17, 2017, 7:53pm UTC](https://forum.ansible.com/t/how-to-retain-stdout-formatting-when-using-adhoc-commands-shell-module/25283/3 "2017-08-17T19:53:23Z")

</div>

I think so, but wasn’t able to get that working with adhoc commands.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 18, 2017, 8:41pm UTC](https://forum.ansible.com/t/how-to-retain-stdout-formatting-when-using-adhoc-commands-shell-module/25283/4 "2017-08-18T20:41:37Z")

</div>

What formatting are you missing? I get this:

$ ansible localhost -a "toilet -f letter Ansible"  
localhost | SUCCESS | rc=0 \>\>  
&nbsp;&nbsp;&nbsp;A N N SSSS III BBBB L EEEEE  
&nbsp;&nbsp;A A NN N S I B B L E  
AAAAA N N N SSS I BBBB L EEEE  
A A N NN S I B B L E  
A A N N SSSS III BBBB LLLLL EEEEE
