# How to pass text string to CLI?

**URL:** <https://forums.digi.com/t/how-to-pass-text-string-to-cli/4219>\
**Category:** NET+OS\
**Tags:** ssh-cli\
**Created:** [May 13, 2010, 4:08pm UTC](https://forums.digi.com/t/how-to-pass-text-string-to-cli/4219 "2010-05-13T16:08:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrey](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Andrey](https://forums.digi.com/u/Andrey)\
**Post date:** [May 13, 2010, 4:08pm UTC](https://forums.digi.com/t/how-to-pass-text-string-to-cli/4219/1 "2010-05-13T16:08:01Z")

</div>

Hello,  
My hardware is controlled via telnet or SSH CLI. I need to execute several commands from a file on FLASH0/.  
Is there an easy way to pass a text string to CLI?

---

<div class="post-metadata">

**Author:** ![egawtry](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@egawtry](https://forums.digi.com/u/egawtry)\
**Post date:** [May 14, 2010, 12:13am UTC](https://forums.digi.com/t/how-to-pass-text-string-to-cli/4219/2 "2010-05-14T00:13:53Z")

</div>

Take a look at the CLI code in sys. It has an api for adding comands. I am out of town right now or else I’d post some code. If you are still puzzled on Monday, let me know.

-Erik

---

<div class="post-metadata">

**Author:** ![Andrey](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Andrey](https://forums.digi.com/u/Andrey)\
**Post date:** [May 14, 2010, 11:00pm UTC](https://forums.digi.com/t/how-to-pass-text-string-to-cli/4219/3 "2010-05-14T23:00:45Z")

</div>

I know how to add commands, but they are all invoked from the telnet client. I need to force the CLI to execute command from a string.  
Well, I see the recurrency issue here. The CLI is calling my function in which I want to call the CLI with another command.  
The most reliable would be to interpret the string internally. I am going this way…
