3 Replies - 1187 Views - Last Post: 24 July 2017 - 09:48 AM

#1 mercy_angel  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 320
  • Joined: 28-February 13

bash script must be executable, can i make allways be?

Posted 24 July 2017 - 05:03 AM

i am having a bash script that is going to be used on multiple pcs. Does it possible to somehow include chmod +x into script? I tried to add executable and than transfer, but it is not exec, i must add it mannualy. Can I somehow deal with it or i must allways put command chmod +x
Is This A Good Question/Topic? 0
  • +

Replies To: bash script must be executable, can i make allways be?

#2 jimblumberg  Icon User is offline

  • member icon

Reputation: 5304
  • View blog
  • Posts: 16,521
  • Joined: 25-December 09

Re: bash script must be executable, can i make allways be?

Posted 24 July 2017 - 07:39 AM

Quote

Can I somehow deal with it or i must allways put command chmod +x

It seems that you are dealing with "it" by "manually" modifying the executable bit. What is wrong with manually modifying the bit instead of trying to "magically" overcome a security feature? After all to modify the executable bit you need administrator access and allowing a program being run by any Joe Blow user to modify the executable bit should be a violation of security policy.

Jim

This post has been edited by jimblumberg: 24 July 2017 - 07:40 AM

Was This Post Helpful? 0
  • +
  • -

#3 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1469
  • View blog
  • Posts: 8,176
  • Joined: 07-September 06

Re: bash script must be executable, can i make allways be?

Posted 24 July 2017 - 08:10 AM

If you create a tarball of the file(s) before transferring them, they should automatically retain their permissions; however there is also a -p option to tell it to retain permission values when extracting. Zip may also offer similar capabilities, but I don't normally use it.
Was This Post Helpful? 1
  • +
  • -

#4 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6544
  • View blog
  • Posts: 30,651
  • Joined: 10-May 07

Re: bash script must be executable, can i make allways be?

Posted 24 July 2017 - 09:48 AM

I was going to offer the same answer as BetaWar. You would need to create an archive of the file & deploy it so that it retains the file permissions.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1