# Host: command output differs on localhost and FQDN

**URL:** <https://forum.ansible.com/t/host-command-output-differs-on-localhost-and-fqdn/24978>\
**Category:** Ansible Project\
**Created:** [July 13, 2017, 9:05pm UTC](https://forum.ansible.com/t/host-command-output-differs-on-localhost-and-fqdn/24978 "2017-07-13T21:05:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Listing](https://avatars.discourse-cdn.com/v4/letter/l/3d9bf3/32.png) [@Listing](https://forum.ansible.com/u/Listing)\
**Post date:** [July 13, 2017, 9:05pm UTC](https://forum.ansible.com/t/host-command-output-differs-on-localhost-and-fqdn/24978/1 "2017-07-13T21:05:11Z")

</div>

Hi,

I am trying to run the following playbook:

`

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [July 14, 2017, 1:08pm UTC](https://forum.ansible.com/t/host-command-output-differs-on-localhost-and-fqdn/24978/2 "2017-07-14T13:08:31Z")

</div>

It'll be a path thing most likely. It's in your path on localhost, and  
not on the account you're using remotely.

---

<div class="post-metadata">

**Author:** ![Listing](https://avatars.discourse-cdn.com/v4/letter/l/3d9bf3/32.png) [@Listing](https://forum.ansible.com/u/Listing)\
**Post date:** [July 14, 2017, 5:46pm UTC](https://forum.ansible.com/t/host-command-output-differs-on-localhost-and-fqdn/24978/3 "2017-07-14T17:46:36Z")

</div>

Hi Dick,

This indeed seems to be the case when I compared paths. How is this possible? The ‘remote’ machine is the exact same machine as the ‘localhost’, I only just connect by FQDN.

---

<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:** [July 14, 2017, 6:04pm UTC](https://forum.ansible.com/t/host-command-output-differs-on-localhost-and-fqdn/24978/4 "2017-07-14T18:04:51Z")

</div>

That is a feature with the shell.  
Most shell(at least sh and bash do) have two mode interactive shell and non interactive shell.  
Interactive shell is when you log in and get a prompt, non interactive is when you run commands over ssh.

The two mode reads different environment file (man sh or bash to read more about it).

When you are running with localhost you are executing the commands with you interactive shell, but when you use FQDN you are ssh in to the host and get the not interactive shell.

---

<div class="post-metadata">

**Author:** ![Listing](https://avatars.discourse-cdn.com/v4/letter/l/3d9bf3/32.png) [@Listing](https://forum.ansible.com/u/Listing)\
**Post date:** [July 15, 2017, 3:32pm UTC](https://forum.ansible.com/t/host-command-output-differs-on-localhost-and-fqdn/24978/5 "2017-07-15T15:32:08Z")

</div>

Cool, did not know that! Thnx for your help.
