0

Why terminal IDE (a terminal emulator for Android) doesn't execute some .sh files on my rooted Android device?(the error is: "permission denied") I have typed this code in terminal:

su
sh dprompt.sh

and "dprompt.sh" contains this code:

export PS1=myStyle#
Schullz
  • 283
  • 1
  • 6
  • 18

1 Answers1

1

Maybe the script does not have the executable permission set?

Aside from that, you cannot execute it in a subshell (using the sh command), because you are exporting the variable to shells created from that subshell, but that subshell is going to die immediately, and you are going to return to the parent shell (the interactive one), with the PS1 variable unchanged.

To fix it, you must source the script, executing it with:

. dprompt.sh

That way, the script is execute in the current shell, without issuing a new one, so the variable is changed for the current shell.

Alvaro Gutierrez Perez
  • 3,669
  • 1
  • 16
  • 24