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
  • 70,465
Kayz5ive
  • 29
  • 1
  • 2
  • 6
  • 2
    Please don't use 777, use 755 or just chmod a+x instead. That said, what is your question? Do you need help running that command? Do you know how to open a terminal? Please [edit] your question and explain what part of this is giving you trouble. – terdon Nov 08 '18 at 19:04
  • Also, * is a wildcard which means if you use *.sh, all files with extension as sh in current folder will be effected. – Kulfy Nov 08 '18 at 19:09

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
  • 100,812
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

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497