Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Bash script to check permission and store it

function permchk (){

        if [ -z "$1" ]; then
        echo "Enter path: ./test path"
else
        namecal="$(basename ${1}).$(date +%F).$$"
        touch ~/$namecal
        truncate -s 0 ~/$namecal
        result=$(sudo ls -ld ${1} >> ~/$namecal)
fi
}

permchk $1

if [[ $? -eq 0 && ! -z permchk ]]; then
        echo "permission check completed."
        vim ~/$namecal
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: chown to current user 
Shell :: how to get a github user profile image download url 
Shell :: how to kill looped process by command name 
Shell :: running ethermine on linux 
Shell :: shell randomly permute lines 
Shell :: Linux using GitHub 
Shell :: add string at the end of each line 
Shell :: git diff no context 
Shell :: how to write red text in readme in github 
Shell :: dokcer not working 
Shell :: terminal find containing directory of file and cd to directory 
Shell :: git create new repo in git bash/ terminal 
Shell :: get pid of proccess 
Shell :: not able to start conda navigator ubuntu 18.04 
Shell :: brew on windows 
Shell :: Cannot open: https://centos7.iuscommunity.org/ius-release.rpm. Skipping 
Shell :: activar htaccess en apache 
Shell :: powershell computer information 
Shell :: how to change elementary os theme 
Shell :: pyqt designer for linux 
Shell :: windows stop service 
Shell :: How to use Git for Unity3D source control? 
Shell :: which path of executable powershell 
Shell :: how to checkout a remote branch in git 
Shell :: shopware 6 build storefront 
Shell :: difference between git remote and git clone 
Shell :: linux password expires date 
Shell :: cut powershell 
Shell :: how to login as root user in kubernetes pod 
Shell :: snap install ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =