anupam
anupam

Reputation: 135

running a script from termux-task tasker plugin

I am not able to run a simple script( ls command ) from termux-tasker plugin which i am successfully able to do when i am in termux app in same directory. What could be the cause ?

Termux -tasker plugin requires requires creation of .termux/tasker directory /data/data/com.termux/files/home/.termux/tasker which i have done

Here are things which i have tried so far

## from termux app

    $ sh /data/data/com.termux/files/home/.termux/tasker/script1.sh

$ sh ./data/data/com.termux/files/home/.termux/tasker/script1.sh

sh: 0: Can't open ./data/data/com.termux/files/home/.termux/tasker/script1.sh

$ bash /data/data/com.termux/files/home/.termux/tasker/script1.sh

$ bash ./data/data/com.termux/files/home/.termux/tasker/script1.sh

bash: ./data/data/com.termux/files/home/.termux/tasker/script1.sh: No such file or directory

$ cd /data/data/com.termux/files/home/.termux/tasker

$ ls

num.py script.sh script1.sh

$ sh script1.sh

num.py script.sh script1.sh:

## from termux-tasker plugin

exec("/data/data/com.termux/files/home/.termux/tasker/script1.sh"): No such file or directory

Upvotes: 1

Views: 5662

Answers (1)

Eden
Eden

Reputation: 41

Did you add a proper shebang?

#! /data/data/com.termux/files/usr/bin/bash

Add this line to the first line in your script. I had the same problem at first and this solved it. I think Tasker might be using /system/bin/sh as default.

Upvotes: 4

Related Questions