# Output of script & newline

**URL:** <https://forum.ansible.com/t/output-of-script-newline/18196>\
**Category:** Ansible Project\
**Created:** [May 8, 2015, 9:55pm UTC](https://forum.ansible.com/t/output-of-script-newline/18196 "2015-05-08T21:55:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [May 8, 2015, 9:55pm UTC](https://forum.ansible.com/t/output-of-script-newline/18196/1 "2015-05-08T21:55:34Z")

</div>

ansible 1.9.0.1

- name: Get java version  
script: /tmp/javaver.sh  
register: java\_ver

- name: Touch test file  
copy: dest=“/tmp/{{ java\_ver.stdout }}”  
content=“test”

TASK: [Show output from installer] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [flamingo] =\> {  
“msg”: “1.8.0\_45\n”  
}

joliver@flamingo U\_JRE7\_UNIX\_V1R4\_prep $ ls -l /tmp/  
total 32  
-rw-r–r-- 1 joliver staff 4 May 8 14:45 1.8.0\_45?

Adding ‘\_lines’ get a file called:

[‘1.8.0\_45’]

How do I have ansible not try to interpret the newline?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 8, 2015, 10:03pm UTC](https://forum.ansible.com/t/output-of-script-newline/18196/2 "2015-05-08T22:03:32Z")

</div>

Use the |trim jinja2 filter to strip whitespace off of the ends.
