1

My touch overlay is failing to respond in portrait but in landscape I got to a page where I am able to rotate touch input so that it can work in portrait (using this advice on Ubuntu Forums), so I have to make the .sh scripts and run them. I am working with shell scripts for the first time and I am using the ones on this page and it asked me not to forget to set chmod to execute for .sh files using this code:

chmod 777 *.sh
Zanna
  • 72,312

2 Answers2

3
  1. Easy way in Kubuntu (Ubuntu is the same). Properties of sh file that you need to change.

solutionOne

  1. Just open a terminal and go into the folder where you handle the .sh file (like mine below), and run chmod a+x foo.sh where foo.sh is the name of the script.

    cd /path/to/script/directory
    chmod a+x foo.sh
    
terdon
  • 104,119
peanek
  • 53
0

The way question sounds is "How do I automate making .sh files ( or scripts in general ) executable?" And the answer is that you can't without changing the default permissions for newly created files. That's done via umask. The .sh files aren't special, they're just text files at very basic level. But of course you don't want to change umask to give executable permission to any random text file that's been just created, because you're opening a Pandora's box of security holes for yourself.

So the answer is you can't automate that without unreasonable security hole. Better approach is just to get into habits of running chmod yourself or running scripts as argument to appropriate interpreter such as bash foo.sh. Or make a shell function to call your favorite text editor to create a file and then chmod, for instance

makesh(){
    for i; do
        vi "$i"
        chmod +x "$i"
    done
 }

I know this answer isn't pretty of fun, but it's practical