# Getting register value

**URL:** <https://forum.ansible.com/t/getting-register-value/13148>\
**Category:** Ansible Project\
**Created:** [July 18, 2013, 2:38am UTC](https://forum.ansible.com/t/getting-register-value/13148 "2013-07-18T02:38:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![celine](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@celine](https://forum.ansible.com/u/celine)\
**Post date:** [July 18, 2013, 2:38am UTC](https://forum.ansible.com/t/getting-register-value/13148/1 "2013-07-18T02:38:55Z")

</div>

How do I get the results from register?

- name: check permission  
shell: find {{gPath}} -printf “%m\n”  
register: results

- name: Print results  
action: debug msg=“{{results.stdout\_lines}}”

What i got from results.stdout\_lines is [u’755’]. How do i get just the value 755? I wish to pass this value to another task later on. Maybe to set permission using this value for another file.

Thank you.

---

<div class="post-metadata">

**Author:** ![Rodney\_Quillo](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Rodney\_Quillo](https://forum.ansible.com/u/Rodney_Quillo)\
**Post date:** [July 18, 2013, 3:17am UTC](https://forum.ansible.com/t/getting-register-value/13148/2 "2013-07-18T03:17:58Z")

</div>

Can you try:

action: debug msg= {{results.stdout}}

---

<div class="post-metadata">

**Author:** ![celine](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@celine](https://forum.ansible.com/u/celine)\
**Post date:** [July 18, 2013, 3:31am UTC](https://forum.ansible.com/t/getting-register-value/13148/3 "2013-07-18T03:31:06Z")

</div>

It works. Thank you 🙂

---

<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:** [July 18, 2013, 3:31am UTC](https://forum.ansible.com/t/getting-register-value/13148/4 "2013-07-18T03:31:18Z")

</div>

The long story is the debug module likes to print strings, it is not really a datastructure printer or anything. result.stdout\_lines is of course a list in this case.

The best way to see what data is available remains to be “-v” on the ansible playbook run, and passing it to another task is then pretty straightforward.

You would most likely iterate across it with “with\_items”.

- debug: msg=Hi I’ve got an {{ item }}  
with\_items: results.stdout\_lines.

etc

Using that with debug _will_ print it nicely.
