# Question: how to Use name of shell script as value to variable and execute it

**URL:** <https://forum.ansible.com/t/question-how-to-use-name-of-shell-script-as-value-to-variable-and-execute-it/33048>\
**Category:** Ansible Project\
**Created:** [May 29, 2020, 10:31am UTC](https://forum.ansible.com/t/question-how-to-use-name-of-shell-script-as-value-to-variable-and-execute-it/33048 "2020-05-29T10:31:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Memon](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Adam\_Memon](https://forum.ansible.com/u/Adam_Memon)\
**Post date:** [May 29, 2020, 10:31am UTC](https://forum.ansible.com/t/question-how-to-use-name-of-shell-script-as-value-to-variable-and-execute-it/33048/1 "2020-05-29T10:31:46Z")

</div>

Hi All,

I have a requirement to login to multiple application servers and just run different scripts individually on different servers  
Rather than creating task for each server - I would like to just create one task with name of the shell script in a variable

How can we implement this

Eg :  
====inventory file===

[APP]  
[host1.example.com](http://host1.example.com) path=/home/app script=start.sh

[host2.example.com](http://host2.example.com) path=/home/app2 script=echo y | start\_app.sh

===YAML file===
