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

Post by jamied_uk on 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
avatar
jamied_uk
Admin

Posts : 2442
Join date : 2010-05-09
Age : 35
Location : UK

http://address-shortner.co.uk

Back to top Go down

Back to top

- Similar topics

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