seduction
 Language:
Welcome, Guest. Please login or register.
Did you miss your activation email?
2020/02/29, 13:33:26


Help

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Scripts executable by default  (Read 2642 times)

0 Members and 1 Guest are viewing this topic.

Offline tosidornottosid

  • User
  • Posts: 11
Scripts executable by default
« on: 2013/10/15, 08:03:40 »
Hello!

How can we set every script or script-like entity
executable by default in our system?

Sometimes it is very time-consuming (and boring) to
set scripts executable one by one. I have observed that
on my Debian installation it goes like that: scripts are set executable by default.

How can we achieve this on siduction? I know it is not very
secure, but...

Thanks!

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 1.954
    • Land of the Buckeye
RE: Scripts executable by default
« Reply #1 on: 2013/10/15, 20:51:52 »
Excuse me for challenging the question -- I hate it if anyone does that to me -- but it seems a very unusual question.  (I have never heard it in 7 years of using Linux).

Executable by whom?

And what problem, exactly, is this trying to solve? (What script does not have execute permissions, that needs to be changed)?
Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO, 2@WD1003FZEX in BTRFS

Offline tosidornottosid

  • User
  • Posts: 11
RE: Scripts executable by default
« Reply #2 on: 2013/10/17, 01:08:53 »
Ok! I will give the real example in order to be precise.

I use, alongside the native linux software, a few java applications. When I install a new system, like I did a month ago with siduction, I copy these applications to the hard drive. They are standalone. Every one of them has a
shell script. I use these scripts to create the Menu entries for these applications.

So this is the issue: I had to make executable every one of them. They
where not executable by default. Sometimes, I had to search to the subfolders too. For example, in Haundrix Chess, I had to make executable not only the main program file, but also the chess engines that where inside some strange subfolder.

So I have this question because I noticed that on my Debian Sid installation, all these scripts are executable by default. That is, just by copying them to the hard drive. I don't have to go to very single one of them and make them executable. So, Debian sees them as executables by default, while siduction sees them as text files.

And I wonder if this is a general system setting, or maybe a file manager setting? I use KDE and Dolphin.

Of course, this is not a serious matter, I am just curious...

I hope I gave a better explanation this time!

Offline ralul

  • User
  • Posts: 1.809
RE: Scripts executable by default
« Reply #3 on: 2013/10/17, 01:58:29 »
Make yourself a script:
Code: [Select]
#!/bin/bash
[ -z $1 ] && exit
[ -d "$1" ] || exit
find "$1" | while read f; do
 [ -f "$f" ] || continue
 h=$(head -n 1 "$f")
 [ "${h:0:3}" = "#!/" ] && chmod +x "$f"
done
experiencing siduction runs better than my gentoo makes me know I know nothing