Saturday, February 26, 2022

[SOLVED] How to start a script in termux from an app

Issue

I need to start a script in a termux environment on my android tablet from an other android app. I think it should be possible in two ways.

  1. setting up some kind of startup script (like the ~/.bashrc in the bash shell) in termunx and starting termux from the other app
  2. calling termux from the other app with the script name as parameter, so that termux executes that script immediately.

I don't know how to do either of these possibilities. Does anybody know how to accomplish it, maybe with a third method, I didn't think of so far?


Solution

I didn't see the wood for the trees. The answer is exactly my first suggested way. I didn't realize, that bash is the default shell in termux. So just one of .bashrc .profile .bash_profile do the job.



Answered By - thr
Answer Checked By - David Goodson (WPSolving Volunteer)