# Default shell behavior: Where are scripts executed? No such file or directory.

**URL:** <https://forum.ansible.com/t/default-shell-behavior-where-are-scripts-executed-no-such-file-or-directory/26972>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [March 12, 2018, 8:56pm UTC](https://forum.ansible.com/t/default-shell-behavior-where-are-scripts-executed-no-such-file-or-directory/26972 "2018-03-12T20:56:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 12, 2018, 8:56pm UTC](https://forum.ansible.com/t/default-shell-behavior-where-are-scripts-executed-no-such-file-or-directory/26972/1 "2018-03-12T20:56:07Z")

</div>

shell executes on the remote machine, it does not look for any  
resources 'local' to the controller, the 'working directory' depends  
on login/become setup used on the target machine (normally  
/home/\<remote\_user|become\_user\>.

But this is only important for relative paths.

---

<div class="post-metadata">

**Author:** ![Patrick\_Hunt](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@Patrick\_Hunt](https://forum.ansible.com/u/Patrick_Hunt)\
**Post date:** [March 13, 2018, 12:29pm UTC](https://forum.ansible.com/t/default-shell-behavior-where-are-scripts-executed-no-such-file-or-directory/26972/2 "2018-03-13T12:29:49Z")

</div>

Your subject line has a question in it, but the body does not. Is your question “Where are scripts executed?” If that is your question then yes, you’re correct, it should be the home directory of the user you logged into the remote server with. You can see by doing something like  
`

ansible servera -m shell -a “ls”-u username  
`

This will print the contents of the working directory when a user logs in. Try it with the become options to see what the result is. You can use an absolute path to call a script. Or use the “chdir” option for shell, something like

`
