Ubuntu Forums Archive Viewer

Bash scripting on Ubuntu Phone

Archived thread 2271224 from Ubuntu Phone and Tablet. Markdown source: Ubuntu_Phone_and_Tablet/thread_2271224_Bash_scripting_on_Ubuntu_Phone.md

Original URL About this archive
#1

Hello, I just received my Aquaris E4.5 Ubuntu Edition, and would like to do some bash scripting. I am getting the error in the screenshot (/bin/sh bad interpreter permission denied). When I execute the script with sh, bash or . before the command, it works properly. Does anyone know whether /bin/sh has been blocked for a reason (security?) or that there may be a bug somewhere? [ATTACH=CONFIG]260947[/ATTACH]

Thanks

#2

I will give you a wild guess that is based on a little knowledge about Ubuntu phones and no experience using one.

Apps on the Ubuntu phone are tightly control by Apport to prevent them doing anything they should not be doing. It seems that bash is allowed to run that script and cat is allowed to print the contents of the script to the screen but maybe the script itself is not allowed to run because there is not an apport profile for it.

Regards.

#3

what about trying to put "sudo" upfront?

#4

Works fine: phablet@ubuntu-phablet:~$ ./test.sh hallo phablet@ubuntu-phablet:~$ cat test.sh #!/bin/sh echo hallo

#5

./test.sh - permission denied?

Already chmod u+x right?

#6

and /bin/sh is not the bash shell /bin/bash ;)