PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Add Execute Permissions To A File In Linux With A Script Or Function

Go down

Add Execute Permissions To A File In Linux With A Script Or Function Empty Add Execute Permissions To A File In Linux With A Script Or Function

Post by jamied_uk 20th June 2018, 15:54




Script:


Code:
#!/bin/bash
# (c) J_Net 2018
#
# jnet.forumotion.com/t1640-add-execute-permissions-to-a-file-in-linux-with-a-script-or-function#2525
#
# Example: ./exec.sh file.sh
#
sudo chmod +x "$1"
echo "$1 Has Been Made Executable"


Function: (For .bashrc file).


Code:
function x(){
sudo chmod +x "$1"
echo "$1 Has Been Made Executable"
}


Now you can just type

Code:
x *.sh
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum